From 548e94c993a9180b7ec2456d6315fb97826e4eb8 Mon Sep 17 00:00:00 2001 From: Quentin Le Menez Date: Fri, 13 Jan 2017 16:40:01 +0100 Subject: Bug 510937 - [TEST] [REFACTOR] [OXYGEN] The tests for Papyrus' main plugins should be clearer to visualize during execution on the server and segmented to respect the plugin's architecture Change-Id: I5125c9ae1552ef8144aff12881e0ba2cfb1be102 Signed-off-by: Quentin Le Menez --- .../META-INF/MANIFEST.MF | 30 - .../.classpath | 7 - .../.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 ------- .../.settings/org.eclipse.jdt.ui.prefs | 68 -- .../META-INF/MANIFEST.MF | 47 -- .../about.html | 28 - .../build.properties | 7 - .../model/basic/complex_multipage_model.di | 237 ------ .../model/basic/complex_multipage_model.notation | 578 -------------- .../model/basic/complex_multipage_model.uml | 178 ----- .../model/basic/delete_contained_diagram.di | 35 - .../model/basic/delete_contained_diagram.notation | 282 ------- .../model/basic/delete_contained_diagram.uml | 49 -- .../model/basic/delete_contained_table.di | 31 - .../model/basic/delete_contained_table.notation | 666 ---------------- .../model/basic/delete_contained_table.uml | 16 - .../model/basic/delete_sash_page.di | 15 - .../model/basic/delete_sash_page.notation | 49 -- .../model/basic/delete_sash_page.uml | 9 - .../model/basic/empty_model.di | 9 - .../model/basic/empty_model.notation | 2 - .../model/basic/empty_model.uml | 2 - .../model/basic/simple_class_model.di | 17 - .../model/basic/simple_class_model.notation | 93 --- .../model/basic/simple_class_model.uml | 16 - .../model/basic/simple_table_model.di | 193 ----- .../model/basic/simple_table_model.notation | 2 - .../model/basic/simple_table_model.uml | 6 - .../model/basic/simple_uml_generic_table_model.di | 17 - .../basic/simple_uml_generic_table_model.notation | 125 --- .../model/basic/simple_uml_generic_table_model.uml | 2 - .../model/basic/table.di | 12 - .../model/basic/table.notation | 219 ------ .../model/basic/table.uml | 4 - .../model/basic/two_diagrams_model.di | 20 - .../model/basic/two_diagrams_model.notation | 16 - .../model/basic/two_diagrams_model.uml | 12 - .../model/basic/two_tables_model.di | 20 - .../model/basic/two_tables_model.notation | 54 -- .../model/basic/two_tables_model.uml | 13 - .../model/basic/unnamed_diagram.di | 12 - .../model/basic/unnamed_diagram.notation | 93 --- .../model/basic/unnamed_diagram.uml | 16 - .../model/canonical/css_leaktest.di | 2 - .../model/canonical/css_leaktest.notation | 66 -- .../model/canonical/css_leaktest.uml | 9 - .../model/model set/^&_&^.di | 205 ----- .../model/model set/^&_&^.notation | 107 --- .../model/model set/^&_&^.uml | 6 - .../model/profile/j2ee-no-constraints.profile.uml | 252 ------ .../model/profile/j2ee.profile.uml | 317 -------- .../model/profile/model-no-j2ee-constraints.di | 12 - .../profile/model-no-j2ee-constraints.notation | 71 -- .../model/profile/model-no-j2ee-constraints.uml | 26 - .../model/profile/model.di | 12 - .../model/profile/model.notation | 71 -- .../model/profile/model.uml | 26 - .../model/recovery/complex_invalid_model.di | 407 ---------- .../model/recovery/complex_invalid_model.notation | 560 -------------- .../model/recovery/complex_invalid_model.uml | 129 ---- .../model/recovery/empty_di_model.di | 3 - .../model/recovery/empty_di_model.notation | 92 --- .../model/recovery/empty_di_model.uml | 16 - .../model/recovery/invalidAvailablePage.di | 24 - .../model/recovery/invalidAvailablePage.notation | 131 ---- .../model/recovery/invalidAvailablePage.uml | 17 - .../model/recovery/invalid_child_tab.di | 18 - .../model/recovery/invalid_child_tab.notation | 5 - .../model/recovery/invalid_child_tab.uml | 2 - .../model/recovery/missing_page_recovery.di | 12 - .../model/recovery/missing_page_recovery.notation | 92 --- .../model/recovery/missing_page_recovery.uml | 16 - .../model/recovery/proxy_diagram_recovery.di | 23 - .../model/recovery/proxy_diagram_recovery.notation | 98 --- .../model/recovery/proxy_diagram_recovery.uml | 16 - .../model/recovery/proxy_table_recovery.di | 199 ----- .../model/recovery/proxy_table_recovery.notation | 92 --- .../model/recovery/proxy_table_recovery.uml | 19 - .../model/reload/banking.di | 12 - .../model/reload/banking.notation | 91 --- .../model/reload/banking.uml | 35 - .../model/reload/employment.di | 18 - .../model/reload/employment.notation | 415 ---------- .../model/reload/employment.uml | 44 -- .../model/reload/employment_sashes.di | 22 - .../model/reload/employment_sashes.notation | 415 ---------- .../model/reload/employment_sashes.uml | 44 -- .../model/reload/library.di | 12 - .../model/reload/library.notation | 72 -- .../model/reload/library.uml | 26 - ...eclipse.papyrus.editor.integration.tests.launch | 43 -- .../pom.xml | 15 - .../editor/integration/tests/Activator.java | 76 -- .../papyrus/editor/integration/tests/AllTests.java | 41 - .../tests/tests/AbstractEditorIntegrationTest.java | 26 - .../tests/tests/EditingMemoryLeakFixture.java | 197 ----- .../tests/EditingScenariosMemoryLeakTest.java | 162 ---- .../tests/tests/EditorMemoryLeakTest.java | 202 ----- .../integration/tests/tests/EditorReloadTest.java | 719 ----------------- .../integration/tests/tests/ModelSetTests.java | 128 ---- .../integration/tests/tests/PageManagerTests.java | 567 -------------- .../integration/tests/tests/RecoveryTest.java | 175 ----- .../.classpath | 7 - .../.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 ------- .../.settings/org.eclipse.jdt.ui.prefs | 68 -- .../ClipboardTests.launch | 43 -- .../META-INF/MANIFEST.MF | 17 - .../about.html | 28 - .../build.properties | 20 - .../plugin.properties | 3 - .../plugin.xml | 23 - .../pom.xml | 15 - .../core/clipboard/tests/AWTClipboardUtils.java | 45 -- .../infra/core/clipboard/tests/Activator.java | 63 -- .../infra/core/clipboard/tests/AllTests.java | 28 - .../infra/core/clipboard/tests/ClipboardTests.java | 86 --- .../core/clipboard/tests/CopierFactoryTest.java | 185 ----- .../core/clipboard/tests/SWTClipboardUtils.java | 53 -- .../.classpath | 7 - .../.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 ------- .../.settings/org.eclipse.jdt.ui.prefs | 68 -- .../META-INF/MANIFEST.MF | 16 - .../OSGI-INF/l10n/bundle.properties | 3 - .../about.html | 28 - .../build.properties | 6 - .../org.eclipse.papyrus.sasheditor.di.tests.launch | 41 - .../pom.xml | 15 - .../di/contentprovider/DiSashModelMngrTest.java | 201 ----- .../di/contentprovider/FakeModelFactory.java | 36 - .../internal/AbstractDiContentProviderTest.java | 394 ---------- .../di/contentprovider/internal/CheckVisitor.java | 119 --- .../internal/ContentChangeListener.java | 43 -- .../internal/CreateModelVisitor.java | 147 ---- .../internal/DiContentProvider2Test.java | 67 -- .../internal/DiContentProviderBaseVisitor.java | 326 -------- .../internal/DiContentProviderFacade.java | 441 ----------- .../internal/DiContentProviderFacadeTest.java | 44 -- .../internal/DiContentProviderTest.java | 321 -------- .../internal/FakePageModelFactory.java | 37 - .../internal/PageManagerImplTest.java | 486 ------------ .../di/contentprovider/internal/QueryVisitor.java | 138 ---- .../internal/SashContainerModels.java | 63 -- .../TransactionalDiContentProvider2Test.java | 170 ----- .../di/sashmodel/query/AbstractSash.java | 97 --- .../di/sashmodel/query/CheckVisitor.java | 97 --- .../di/sashmodel/query/CreateModelVisitor.java | 138 ---- .../core/sasheditor/di/sashmodel/query/Folder.java | 126 --- .../core/sasheditor/di/sashmodel/query/HSash.java | 87 --- .../sasheditor/di/sashmodel/query/IQueryExp.java | 28 - .../sasheditor/di/sashmodel/query/IQueryTerm.java | 40 - .../di/sashmodel/query/IQueryVisitor.java | 44 -- .../di/sashmodel/query/NoMatchException.java | 77 -- .../core/sasheditor/di/sashmodel/query/Page.java | 117 --- .../sasheditor/di/sashmodel/query/PanelTerm.java | 76 -- .../di/sashmodel/query/QueryException.java | 77 -- .../di/sashmodel/query/QueryVisitor.java | 124 --- .../di/sashmodel/query/SashModelQuery.java | 220 ------ .../di/sashmodel/query/SashModelQueryTest.java | 194 ----- .../core/sasheditor/di/sashmodel/query/VSash.java | 87 --- .../sasheditor/di/sashmodel/query/WindowTerm.java | 100 --- .../infra/core/sasheditor/di/tests/AllTests.java | 43 -- .../.classpath | 7 - .../.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 ------- .../.settings/org.eclipse.jdt.ui.prefs | 68 -- .../META-INF/MANIFEST.MF | 31 - .../about.html | 28 - .../build.properties | 8 - ...ipse.papyrus.infra.core.sasheditor.tests.launch | 40 - .../plugin.properties | 13 - .../plugin.xml | 20 - .../pom.xml | 15 - ...bstractSashWindowContentProviderFacadeTest.java | 272 ------- .../sasheditor/contentprovider/IPageMngrTest.java | 58 -- .../ISashWindowsContentProviderFacade.java | 220 ------ .../contentprovider/simple/AllTests.java | 26 - .../contentprovider/simple/CheckVisitor.java | 109 --- .../CreateModelInSimpleContentProviderVisitor.java | 157 ---- .../contentprovider/simple/FakePageModel.java | 69 -- .../contentprovider/simple/QueryVisitor.java | 134 ---- .../simple/SimpleContentProviderBaseVisitor.java | 316 -------- .../SimpleSashWindowContainerTestFacade.java | 452 ----------- ...pleSashWindowContainerTestFacadeCommonTest.java | 44 -- .../SimpleSashWindowContainerTestFacadeTest.java | 91 --- .../SimpleSashWindowContentProviderFacade.java | 368 --------- .../SimpleSashWindowContentProviderFacadeTest.java | 151 ---- ...SimpleSashWindowContentProviderFacadeTest2.java | 44 -- .../SimpleSashWindowContentProviderUtils.java | 168 ---- .../SimpleSashWindowContentProviderUtilsTest.java | 115 --- .../SimpleSashWindowsContentProviderTest.java | 326 -------- .../infra/core/sasheditor/editor/AllTests.java | 26 - .../core/sasheditor/editor/FakeEditorModel.java | 137 ---- .../core/sasheditor/editor/MessagePartModel.java | 90 --- .../sasheditor/editor/SashMultiPageEditorTest.java | 25 - .../infra/core/sasheditor/editor/ShellEditor.java | 113 --- .../infra/core/sasheditor/internal/AllTests.java | 31 - .../FakeFolderLifeCycleEventsListener.java | 143 ---- .../internal/FakePageLifeCycleEventsListener.java | 186 ----- .../core/sasheditor/internal/FakePagePart.java | 69 -- .../sasheditor/internal/FakeTabFolderPart.java | 36 - ...lderLifeCycleEventsThrownFromContainerTest.java | 163 ---- ...PageLifeCycleEventsThrownFromContainerTest.java | 336 -------- .../internal/SashContainerEventsProviderTest.java | 186 ----- .../SashWindowsContainerDisposeCalledTest.java | 177 ----- .../SashWindowsContainerMemoryLeakTest.java | 207 ----- .../SashWindowsContainerRefreshTabsTest.java | 119 --- .../internal/SashWindowsContainerTest.java | 643 ---------------- .../internal/TabFolderListManagerTest.java | 95 --- .../core/sasheditor/pagesmodel/AbstractSash.java | 95 --- .../sasheditor/pagesmodel/BadNameException.java | 82 -- .../infra/core/sasheditor/pagesmodel/Folder.java | 90 --- .../infra/core/sasheditor/pagesmodel/HSash.java | 66 -- .../core/sasheditor/pagesmodel/IModelExp.java | 28 - .../core/sasheditor/pagesmodel/IModelObject.java | 38 - .../sasheditor/pagesmodel/IPagesModelVisitor.java | 68 -- .../sasheditor/pagesmodel/NoMatchException.java | 77 -- .../sasheditor/pagesmodel/NotFoundException.java | 82 -- .../infra/core/sasheditor/pagesmodel/Page.java | 116 --- .../sasheditor/pagesmodel/PagesModelException.java | 78 -- .../core/sasheditor/pagesmodel/PanelTerm.java | 74 -- .../core/sasheditor/pagesmodel/SashPagesModel.java | 103 --- .../pagesmodel/SashPagesModelFactory.java | 98 --- .../infra/core/sasheditor/pagesmodel/VSash.java | 66 -- .../core/sasheditor/pagesmodel/WindowTerm.java | 83 -- .../core/sasheditor/pagesmodel/package-info.java | 19 - .../infra/core/sasheditor/tests/AllTests.java | 32 - .../core/sasheditor/tests/texteditor/AllTests.java | 33 - .../tests/texteditor/FakeEditorInput.java | 114 --- .../tests/texteditor/FakeEditorInputTest.java | 46 -- .../tests/texteditor/FakeMultiSashPageEditor.java | 386 ---------- .../texteditor/FakeMultiSashPageEditorTest.java | 252 ------ .../tests/texteditor/TestTextEditor.java | 128 ---- .../tests/texteditor/TextEditorPartModel.java | 129 ---- .../ISashWindowsContentProviderTestUtils.java | 78 -- .../tests/utils/memoryleak/LeakingObject.java | 19 - .../tests/utils/memoryleak/MemoryLeakTest.java | 79 -- .../tests/utils/memoryleak/MemoryLeakUtil.java | 201 ----- .../tests/utils/memoryleak/NonLeakingObject.java | 20 - .../core/sasheditor/tests/utils/package-info.java | 19 - .../tests/utils/trace/ITraceRecords.java | 87 --- .../tests/utils/trace/MultiValuesTraceRecord.java | 73 -- .../tests/utils/trace/NullTraceRecords.java | 155 ---- .../tests/utils/trace/SimpleTraceRecord.java | 73 -- .../sasheditor/tests/utils/trace/TraceLogger.java | 115 --- .../sasheditor/tests/utils/trace/TraceRecord.java | 121 --- .../sasheditor/tests/utils/trace/TraceRecords.java | 162 ---- .../tests/utils/trace/TraceRecordsFactory.java | 42 - .../sasheditor/utils/FakeObservableListener.java | 84 -- .../core/sasheditor/utils/ObservableListTest.java | 173 ----- .../.classpath | 11 - .../org.eclipse.papyrus.infra.core.tests/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 ------- .../.settings/org.eclipse.jdt.ui.prefs | 68 -- .../META-INF/MANIFEST.MF | 15 - .../about.html | 28 - .../build.properties | 9 - .../org.eclipse.papyrus.infra.core.tests.launch | 44 -- .../plugin.properties | 12 - .../plugin.xml | 28 - .../org.eclipse.papyrus.infra.core.tests/pom.xml | 15 - .../resources/My.ecore | 6 - .../resources/My.genmodel | 11 - .../infra/core/language/LanguageServiceTest.java | 191 ----- .../AbstractModelWithSharedResourceTest.java | 328 -------- .../core/resource/AbstractResourceAdapterTest.java | 351 --------- .../papyrus/infra/core/resource/Bug402525.ecore | 6 - .../papyrus/infra/core/resource/FakeModel.java | 67 -- .../core/resource/FakeModelManagerSnippet.java | 62 -- .../core/resource/FakeModelWithSharedResource.java | 100 --- .../papyrus/infra/core/resource/ModelSetTest.java | 691 ----------------- .../NestingTransactionalCommandStackTest.java | 514 ------------- .../infra/core/resource/ResourceAdapterTest.java | 122 --- .../resource/ResourceAdapterTransactionalTest.java | 138 ---- .../papyrus/infra/core/resource/TestTrace.java | 153 ---- .../infra/core/services/ComposedServiceTest.java | 156 ---- .../infra/core/services/FakeComposedService.java | 46 -- .../core/services/FakeComposedServicePart.java | 27 - .../core/services/FakeComposedServicePartA.java | 13 - .../core/services/FakeComposedServicePartB.java | 13 - .../papyrus/infra/core/services/FakeService.java | 75 -- .../infra/core/services/FakeServiceFactory.java | 66 -- .../services/FakeWithRequiredServiceFactory.java | 54 -- .../papyrus/infra/core/services/ServiceA.java | 49 -- .../papyrus/infra/core/services/ServiceA10.java | 6 - .../papyrus/infra/core/services/ServiceB.java | 6 - .../papyrus/infra/core/services/ServiceC.java | 6 - .../papyrus/infra/core/services/ServicePojoA.java | 6 - .../infra/core/services/ServicesRegistryTest.java | 846 --------------------- .../core/services/SharedServiceFactoryTest.java | 399 ---------- .../papyrus/infra/core/services/TestTrace.java | 181 ----- .../eclipse/papyrus/infra/core/tests/AllTests.java | 57 -- .../papyrus/infra/core/utils/AdapterUtilsTest.java | 170 ----- .../infra/core/utils/JobBasedFutureTest.java | 331 -------- .../infra/core/utils/JobExecutorServiceTest.java | 145 ---- .../infra/core/utils/TransactionHelperTest.java | 194 ----- .../core/org.eclipse.papyrus.tests/.classpath | 7 - .../core/org.eclipse.papyrus.tests/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 ------- .../.settings/org.eclipse.jdt.ui.prefs | 68 -- .../AllTestsWithMemoryDump.launch | 42 - .../org.eclipse.papyrus.tests/META-INF/MANIFEST.MF | 97 --- .../Papyrus ALL tests - Failures.launch | 45 -- .../Papyrus ALL tests With Coverage.launch | 42 - .../Papyrus ALL tests.launch | 45 -- .../Papyrus All Headless tests.launch | 46 -- .../Papyrus All UI tests.launch | 45 -- .../Papyrus Core tests (no SysML).launch | 45 -- .../Papyrus Generated Diagram Tests.launch | 45 -- .../Papyrus SysML tests With Coverage.launch | 42 - .../Papyrus SysML tests.launch | 44 -- .../core/org.eclipse.papyrus.tests/about.html | 28 - .../org.eclipse.papyrus.tests/build.properties | 7 - .../org.eclipse.papyrus.tests/plugin.properties | 12 - .../plugins/core/org.eclipse.papyrus.tests/pom.xml | 139 ---- .../test/org/eclipse/papyrus/tests/Activator.java | 50 -- .../org/eclipse/papyrus/tests/AllGenTests.java | 95 --- .../eclipse/papyrus/tests/AllHeadlessTests.java | 45 -- .../test/org/eclipse/papyrus/tests/AllTests.java | 162 ---- .../test/org/eclipse/papyrus/tests/AllUITests.java | 45 -- .../org.eclipse.papyrus.bundles.tests/pom.xml | 2 +- .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 +++++++ .../.settings/org.eclipse.jdt.ui.prefs | 68 ++ .../META-INF/MANIFEST.MF | 17 + .../Papyrus Developer ALL tests.launch | 44 ++ .../about.html | 28 + .../build.properties | 7 + .../plugin.properties | 12 + .../pom.xml | 55 ++ .../papyrus/developer/suite/tests/Activator.java | 54 ++ .../papyrus/developer/suite/tests/AllTests.java | 47 ++ tests/junit/plugins/developer/pom.xml | 26 + .../pom.xml | 2 +- .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 +++++++ .../.settings/org.eclipse.jdt.ui.prefs | 68 ++ .../META-INF/MANIFEST.MF | 47 ++ .../about.html | 28 + .../build.properties | 7 + .../model/basic/complex_multipage_model.di | 237 ++++++ .../model/basic/complex_multipage_model.notation | 578 ++++++++++++++ .../model/basic/complex_multipage_model.uml | 178 +++++ .../model/basic/delete_contained_diagram.di | 35 + .../model/basic/delete_contained_diagram.notation | 282 +++++++ .../model/basic/delete_contained_diagram.uml | 49 ++ .../model/basic/delete_contained_table.di | 31 + .../model/basic/delete_contained_table.notation | 666 ++++++++++++++++ .../model/basic/delete_contained_table.uml | 16 + .../model/basic/delete_sash_page.di | 15 + .../model/basic/delete_sash_page.notation | 49 ++ .../model/basic/delete_sash_page.uml | 9 + .../model/basic/empty_model.di | 9 + .../model/basic/empty_model.notation | 2 + .../model/basic/empty_model.uml | 2 + .../model/basic/simple_class_model.di | 17 + .../model/basic/simple_class_model.notation | 93 +++ .../model/basic/simple_class_model.uml | 16 + .../model/basic/simple_table_model.di | 193 +++++ .../model/basic/simple_table_model.notation | 2 + .../model/basic/simple_table_model.uml | 6 + .../model/basic/simple_uml_generic_table_model.di | 17 + .../basic/simple_uml_generic_table_model.notation | 125 +++ .../model/basic/simple_uml_generic_table_model.uml | 2 + .../model/basic/table.di | 12 + .../model/basic/table.notation | 219 ++++++ .../model/basic/table.uml | 4 + .../model/basic/two_diagrams_model.di | 20 + .../model/basic/two_diagrams_model.notation | 16 + .../model/basic/two_diagrams_model.uml | 12 + .../model/basic/two_tables_model.di | 20 + .../model/basic/two_tables_model.notation | 54 ++ .../model/basic/two_tables_model.uml | 13 + .../model/basic/unnamed_diagram.di | 12 + .../model/basic/unnamed_diagram.notation | 93 +++ .../model/basic/unnamed_diagram.uml | 16 + .../model/canonical/css_leaktest.di | 2 + .../model/canonical/css_leaktest.notation | 66 ++ .../model/canonical/css_leaktest.uml | 9 + .../model/model set/^&_&^.di | 205 +++++ .../model/model set/^&_&^.notation | 107 +++ .../model/model set/^&_&^.uml | 6 + .../model/profile/j2ee-no-constraints.profile.uml | 252 ++++++ .../model/profile/j2ee.profile.uml | 317 ++++++++ .../model/profile/model-no-j2ee-constraints.di | 12 + .../profile/model-no-j2ee-constraints.notation | 71 ++ .../model/profile/model-no-j2ee-constraints.uml | 26 + .../model/profile/model.di | 12 + .../model/profile/model.notation | 71 ++ .../model/profile/model.uml | 26 + .../model/recovery/complex_invalid_model.di | 407 ++++++++++ .../model/recovery/complex_invalid_model.notation | 560 ++++++++++++++ .../model/recovery/complex_invalid_model.uml | 129 ++++ .../model/recovery/empty_di_model.di | 3 + .../model/recovery/empty_di_model.notation | 92 +++ .../model/recovery/empty_di_model.uml | 16 + .../model/recovery/invalidAvailablePage.di | 24 + .../model/recovery/invalidAvailablePage.notation | 131 ++++ .../model/recovery/invalidAvailablePage.uml | 17 + .../model/recovery/invalid_child_tab.di | 18 + .../model/recovery/invalid_child_tab.notation | 5 + .../model/recovery/invalid_child_tab.uml | 2 + .../model/recovery/missing_page_recovery.di | 12 + .../model/recovery/missing_page_recovery.notation | 92 +++ .../model/recovery/missing_page_recovery.uml | 16 + .../model/recovery/proxy_diagram_recovery.di | 23 + .../model/recovery/proxy_diagram_recovery.notation | 98 +++ .../model/recovery/proxy_diagram_recovery.uml | 16 + .../model/recovery/proxy_table_recovery.di | 199 +++++ .../model/recovery/proxy_table_recovery.notation | 92 +++ .../model/recovery/proxy_table_recovery.uml | 19 + .../model/reload/banking.di | 12 + .../model/reload/banking.notation | 91 +++ .../model/reload/banking.uml | 35 + .../model/reload/employment.di | 18 + .../model/reload/employment.notation | 415 ++++++++++ .../model/reload/employment.uml | 44 ++ .../model/reload/employment_sashes.di | 22 + .../model/reload/employment_sashes.notation | 415 ++++++++++ .../model/reload/employment_sashes.uml | 44 ++ .../model/reload/library.di | 12 + .../model/reload/library.notation | 72 ++ .../model/reload/library.uml | 26 + ...eclipse.papyrus.editor.integration.tests.launch | 43 ++ .../pom.xml | 15 + .../editor/integration/tests/Activator.java | 76 ++ .../papyrus/editor/integration/tests/AllTests.java | 41 + .../tests/tests/AbstractEditorIntegrationTest.java | 26 + .../tests/tests/EditingMemoryLeakFixture.java | 197 +++++ .../tests/EditingScenariosMemoryLeakTest.java | 162 ++++ .../tests/tests/EditorMemoryLeakTest.java | 202 +++++ .../integration/tests/tests/EditorReloadTest.java | 719 +++++++++++++++++ .../integration/tests/tests/ModelSetTests.java | 128 ++++ .../integration/tests/tests/PageManagerTests.java | 567 ++++++++++++++ .../integration/tests/tests/RecoveryTest.java | 175 +++++ tests/junit/plugins/editor/pom.xml | 23 + .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 +++++++ .../.settings/org.eclipse.jdt.ui.prefs | 68 ++ .../ClipboardTests.launch | 43 ++ .../META-INF/MANIFEST.MF | 17 + .../about.html | 28 + .../build.properties | 20 + .../plugin.properties | 3 + .../plugin.xml | 23 + .../pom.xml | 15 + .../core/clipboard/tests/AWTClipboardUtils.java | 45 ++ .../infra/core/clipboard/tests/Activator.java | 63 ++ .../infra/core/clipboard/tests/AllTests.java | 28 + .../infra/core/clipboard/tests/ClipboardTests.java | 86 +++ .../core/clipboard/tests/CopierFactoryTest.java | 185 +++++ .../core/clipboard/tests/SWTClipboardUtils.java | 53 ++ .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 +++++++ .../.settings/org.eclipse.jdt.ui.prefs | 68 ++ .../META-INF/MANIFEST.MF | 16 + .../OSGI-INF/l10n/bundle.properties | 3 + .../about.html | 28 + .../build.properties | 6 + .../org.eclipse.papyrus.sasheditor.di.tests.launch | 41 + .../pom.xml | 15 + .../di/contentprovider/DiSashModelMngrTest.java | 201 +++++ .../di/contentprovider/FakeModelFactory.java | 36 + .../internal/AbstractDiContentProviderTest.java | 394 ++++++++++ .../di/contentprovider/internal/CheckVisitor.java | 119 +++ .../internal/ContentChangeListener.java | 43 ++ .../internal/CreateModelVisitor.java | 147 ++++ .../internal/DiContentProvider2Test.java | 67 ++ .../internal/DiContentProviderBaseVisitor.java | 326 ++++++++ .../internal/DiContentProviderFacade.java | 441 +++++++++++ .../internal/DiContentProviderFacadeTest.java | 44 ++ .../internal/DiContentProviderTest.java | 321 ++++++++ .../internal/FakePageModelFactory.java | 37 + .../internal/PageManagerImplTest.java | 486 ++++++++++++ .../di/contentprovider/internal/QueryVisitor.java | 138 ++++ .../internal/SashContainerModels.java | 63 ++ .../TransactionalDiContentProvider2Test.java | 170 +++++ .../di/sashmodel/query/AbstractSash.java | 97 +++ .../di/sashmodel/query/CheckVisitor.java | 97 +++ .../di/sashmodel/query/CreateModelVisitor.java | 138 ++++ .../core/sasheditor/di/sashmodel/query/Folder.java | 126 +++ .../core/sasheditor/di/sashmodel/query/HSash.java | 87 +++ .../sasheditor/di/sashmodel/query/IQueryExp.java | 28 + .../sasheditor/di/sashmodel/query/IQueryTerm.java | 40 + .../di/sashmodel/query/IQueryVisitor.java | 44 ++ .../di/sashmodel/query/NoMatchException.java | 77 ++ .../core/sasheditor/di/sashmodel/query/Page.java | 117 +++ .../sasheditor/di/sashmodel/query/PanelTerm.java | 76 ++ .../di/sashmodel/query/QueryException.java | 77 ++ .../di/sashmodel/query/QueryVisitor.java | 124 +++ .../di/sashmodel/query/SashModelQuery.java | 220 ++++++ .../di/sashmodel/query/SashModelQueryTest.java | 194 +++++ .../core/sasheditor/di/sashmodel/query/VSash.java | 87 +++ .../sasheditor/di/sashmodel/query/WindowTerm.java | 100 +++ .../infra/core/sasheditor/di/tests/AllTests.java | 43 ++ .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 +++++++ .../.settings/org.eclipse.jdt.ui.prefs | 68 ++ .../META-INF/MANIFEST.MF | 31 + .../about.html | 28 + .../build.properties | 8 + ...ipse.papyrus.infra.core.sasheditor.tests.launch | 40 + .../plugin.properties | 13 + .../plugin.xml | 20 + .../pom.xml | 15 + ...bstractSashWindowContentProviderFacadeTest.java | 272 +++++++ .../sasheditor/contentprovider/IPageMngrTest.java | 58 ++ .../ISashWindowsContentProviderFacade.java | 220 ++++++ .../contentprovider/simple/AllTests.java | 26 + .../contentprovider/simple/CheckVisitor.java | 109 +++ .../CreateModelInSimpleContentProviderVisitor.java | 157 ++++ .../contentprovider/simple/FakePageModel.java | 69 ++ .../contentprovider/simple/QueryVisitor.java | 134 ++++ .../simple/SimpleContentProviderBaseVisitor.java | 316 ++++++++ .../SimpleSashWindowContainerTestFacade.java | 452 +++++++++++ ...pleSashWindowContainerTestFacadeCommonTest.java | 44 ++ .../SimpleSashWindowContainerTestFacadeTest.java | 91 +++ .../SimpleSashWindowContentProviderFacade.java | 368 +++++++++ .../SimpleSashWindowContentProviderFacadeTest.java | 151 ++++ ...SimpleSashWindowContentProviderFacadeTest2.java | 44 ++ .../SimpleSashWindowContentProviderUtils.java | 168 ++++ .../SimpleSashWindowContentProviderUtilsTest.java | 115 +++ .../SimpleSashWindowsContentProviderTest.java | 326 ++++++++ .../infra/core/sasheditor/editor/AllTests.java | 26 + .../core/sasheditor/editor/FakeEditorModel.java | 137 ++++ .../core/sasheditor/editor/MessagePartModel.java | 90 +++ .../sasheditor/editor/SashMultiPageEditorTest.java | 25 + .../infra/core/sasheditor/editor/ShellEditor.java | 113 +++ .../infra/core/sasheditor/internal/AllTests.java | 31 + .../FakeFolderLifeCycleEventsListener.java | 143 ++++ .../internal/FakePageLifeCycleEventsListener.java | 186 +++++ .../core/sasheditor/internal/FakePagePart.java | 69 ++ .../sasheditor/internal/FakeTabFolderPart.java | 36 + ...lderLifeCycleEventsThrownFromContainerTest.java | 163 ++++ ...PageLifeCycleEventsThrownFromContainerTest.java | 336 ++++++++ .../internal/SashContainerEventsProviderTest.java | 186 +++++ .../SashWindowsContainerDisposeCalledTest.java | 177 +++++ .../SashWindowsContainerMemoryLeakTest.java | 207 +++++ .../SashWindowsContainerRefreshTabsTest.java | 119 +++ .../internal/SashWindowsContainerTest.java | 643 ++++++++++++++++ .../internal/TabFolderListManagerTest.java | 95 +++ .../core/sasheditor/pagesmodel/AbstractSash.java | 95 +++ .../sasheditor/pagesmodel/BadNameException.java | 82 ++ .../infra/core/sasheditor/pagesmodel/Folder.java | 90 +++ .../infra/core/sasheditor/pagesmodel/HSash.java | 66 ++ .../core/sasheditor/pagesmodel/IModelExp.java | 28 + .../core/sasheditor/pagesmodel/IModelObject.java | 38 + .../sasheditor/pagesmodel/IPagesModelVisitor.java | 68 ++ .../sasheditor/pagesmodel/NoMatchException.java | 77 ++ .../sasheditor/pagesmodel/NotFoundException.java | 82 ++ .../infra/core/sasheditor/pagesmodel/Page.java | 116 +++ .../sasheditor/pagesmodel/PagesModelException.java | 78 ++ .../core/sasheditor/pagesmodel/PanelTerm.java | 74 ++ .../core/sasheditor/pagesmodel/SashPagesModel.java | 103 +++ .../pagesmodel/SashPagesModelFactory.java | 98 +++ .../infra/core/sasheditor/pagesmodel/VSash.java | 66 ++ .../core/sasheditor/pagesmodel/WindowTerm.java | 83 ++ .../core/sasheditor/pagesmodel/package-info.java | 19 + .../infra/core/sasheditor/tests/AllTests.java | 32 + .../core/sasheditor/tests/texteditor/AllTests.java | 33 + .../tests/texteditor/FakeEditorInput.java | 114 +++ .../tests/texteditor/FakeEditorInputTest.java | 46 ++ .../tests/texteditor/FakeMultiSashPageEditor.java | 386 ++++++++++ .../texteditor/FakeMultiSashPageEditorTest.java | 252 ++++++ .../tests/texteditor/TestTextEditor.java | 128 ++++ .../tests/texteditor/TextEditorPartModel.java | 129 ++++ .../ISashWindowsContentProviderTestUtils.java | 78 ++ .../tests/utils/memoryleak/LeakingObject.java | 19 + .../tests/utils/memoryleak/MemoryLeakTest.java | 79 ++ .../tests/utils/memoryleak/MemoryLeakUtil.java | 201 +++++ .../tests/utils/memoryleak/NonLeakingObject.java | 20 + .../core/sasheditor/tests/utils/package-info.java | 19 + .../tests/utils/trace/ITraceRecords.java | 87 +++ .../tests/utils/trace/MultiValuesTraceRecord.java | 73 ++ .../tests/utils/trace/NullTraceRecords.java | 155 ++++ .../tests/utils/trace/SimpleTraceRecord.java | 73 ++ .../sasheditor/tests/utils/trace/TraceLogger.java | 115 +++ .../sasheditor/tests/utils/trace/TraceRecord.java | 121 +++ .../sasheditor/tests/utils/trace/TraceRecords.java | 162 ++++ .../tests/utils/trace/TraceRecordsFactory.java | 42 + .../sasheditor/utils/FakeObservableListener.java | 84 ++ .../core/sasheditor/utils/ObservableListTest.java | 173 +++++ .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 +++++++ .../.settings/org.eclipse.jdt.ui.prefs | 68 ++ .../META-INF/MANIFEST.MF | 20 + .../Papyrus Core tests.launch | 45 ++ .../about.html | 28 + .../build.properties | 7 + .../plugin.properties | 12 + .../pom.xml | 56 ++ .../papyrus/infra/core/suite/tests/Activator.java | 54 ++ .../papyrus/infra/core/suite/tests/AllTests.java | 51 ++ .../.classpath | 11 + .../org.eclipse.papyrus.infra.core.tests/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 +++++++ .../.settings/org.eclipse.jdt.ui.prefs | 68 ++ .../META-INF/MANIFEST.MF | 15 + .../about.html | 28 + .../build.properties | 9 + .../org.eclipse.papyrus.infra.core.tests.launch | 44 ++ .../plugin.properties | 12 + .../plugin.xml | 28 + .../org.eclipse.papyrus.infra.core.tests/pom.xml | 15 + .../resources/My.ecore | 6 + .../resources/My.genmodel | 11 + .../infra/core/language/LanguageServiceTest.java | 191 +++++ .../AbstractModelWithSharedResourceTest.java | 328 ++++++++ .../core/resource/AbstractResourceAdapterTest.java | 351 +++++++++ .../papyrus/infra/core/resource/Bug402525.ecore | 6 + .../papyrus/infra/core/resource/FakeModel.java | 67 ++ .../core/resource/FakeModelManagerSnippet.java | 62 ++ .../core/resource/FakeModelWithSharedResource.java | 100 +++ .../papyrus/infra/core/resource/ModelSetTest.java | 691 +++++++++++++++++ .../NestingTransactionalCommandStackTest.java | 514 +++++++++++++ .../infra/core/resource/ResourceAdapterTest.java | 122 +++ .../resource/ResourceAdapterTransactionalTest.java | 138 ++++ .../papyrus/infra/core/resource/TestTrace.java | 153 ++++ .../infra/core/services/ComposedServiceTest.java | 156 ++++ .../infra/core/services/FakeComposedService.java | 46 ++ .../core/services/FakeComposedServicePart.java | 27 + .../core/services/FakeComposedServicePartA.java | 13 + .../core/services/FakeComposedServicePartB.java | 13 + .../papyrus/infra/core/services/FakeService.java | 75 ++ .../infra/core/services/FakeServiceFactory.java | 66 ++ .../services/FakeWithRequiredServiceFactory.java | 54 ++ .../papyrus/infra/core/services/ServiceA.java | 49 ++ .../papyrus/infra/core/services/ServiceA10.java | 6 + .../papyrus/infra/core/services/ServiceB.java | 6 + .../papyrus/infra/core/services/ServiceC.java | 6 + .../papyrus/infra/core/services/ServicePojoA.java | 6 + .../infra/core/services/ServicesRegistryTest.java | 846 +++++++++++++++++++++ .../core/services/SharedServiceFactoryTest.java | 399 ++++++++++ .../papyrus/infra/core/services/TestTrace.java | 181 +++++ .../eclipse/papyrus/infra/core/tests/AllTests.java | 57 ++ .../papyrus/infra/core/utils/AdapterUtilsTest.java | 170 +++++ .../infra/core/utils/JobBasedFutureTest.java | 331 ++++++++ .../infra/core/utils/JobExecutorServiceTest.java | 145 ++++ .../infra/core/utils/TransactionHelperTest.java | 194 +++++ tests/junit/plugins/infra/core/pom.xml | 25 + .../pom.xml | 2 +- tests/junit/plugins/infra/editor/pom.xml | 22 + .../pom.xml | 2 +- .../pom.xml | 2 +- .../org.eclipse.papyrus.infra.emf.tests/pom.xml | 2 +- .../eclipse/papyrus/infra/emf/tests/AllTests.java | 4 + .../org.eclipse.papyrus.infra.ui.emf.tests/pom.xml | 2 +- tests/junit/plugins/infra/emf/pom.xml | 25 + .../pom.xml | 4 +- .../pom.xml | 4 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- tests/junit/plugins/infra/gmfdiag/pom.xml | 28 + .../pom.xml | 5 +- .../plugins/infra/internationalization/pom.xml | 14 +- .../pom.xml | 5 +- .../pom.xml | 9 +- .../pom.xml | 9 +- .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 +++++++ .../.settings/org.eclipse.jdt.ui.prefs | 68 ++ .../META-INF/MANIFEST.MF | 22 + .../Papyrus Nattable Infra tests.launch | 45 ++ .../about.html | 28 + .../build.properties | 7 + .../plugin.properties | 12 + .../pom.xml | 56 ++ .../infra/nattable/suite/tests/Activator.java | 54 ++ .../infra/nattable/suite/tests/AllTests.java | 52 ++ .../pom.xml | 9 +- .../pom.xml | 9 +- tests/junit/plugins/infra/nattable/pom.xml | 15 +- .../pom.xml | 4 +- .../pom.xml | 4 +- .../.classpath | 7 + .../org.eclipse.papyrus.infra.suite.tests/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 +++++++ .../.settings/org.eclipse.jdt.ui.prefs | 68 ++ .../META-INF/MANIFEST.MF | 42 + .../Papyrus Infra tests.launch | 45 ++ .../about.html | 28 + .../build.properties | 7 + .../plugin.properties | 12 + .../org.eclipse.papyrus.infra.suite.tests/pom.xml | 56 ++ .../papyrus/infra/suite/tests/Activator.java | 54 ++ .../papyrus/infra/suite/tests/AllTests.java | 78 ++ .../org.eclipse.papyrus.infra.tools.tests/pom.xml | 2 +- .../org.eclipse.papyrus.infra.ui.tests/pom.xml | 2 +- tests/junit/plugins/infra/pom.xml | 41 + .../pom.xml | 2 +- tests/junit/plugins/infra/properties/pom.xml | 22 + .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- tests/junit/plugins/infra/services/pom.xml | 27 + .../org.eclipse.papyrus.infra.types.tests/pom.xml | 2 +- .../pom.xml | 2 +- tests/junit/plugins/infra/types/pom.xml | 23 + .../pom.xml | 1 + .../pom.xml | 1 + tests/junit/plugins/infra/viewpoints/pom.xml | 23 + .../plugins/org.eclipse.papyrus.tests/.classpath | 7 + .../plugins/org.eclipse.papyrus.tests/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 +++++++ .../.settings/org.eclipse.jdt.ui.prefs | 68 ++ .../org.eclipse.papyrus.tests/META-INF/MANIFEST.MF | 97 +++ .../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 | 29 + .../.classpath | 7 - .../.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 ------- .../.settings/org.eclipse.jdt.ui.prefs | 68 -- .../META-INF/MANIFEST.MF | 21 - .../Papyrus Diagram Assistants tests.launch | 63 -- .../about.html | 28 - .../build.properties | 17 - .../documentation.pdoc | 4 - .../plugin.properties | 12 - .../pom.xml | 15 - .../papyrus/tests/diagramassistants/AllTests.java | 55 -- .../pom.xml | 8 +- .../alf/org.eclipse.papyrus.uml.alf.tests/pom.xml | 6 +- tests/junit/plugins/uml/alf/pom.xml | 23 + .../pom.xml | 4 +- .../pom.xml | 4 +- tests/junit/plugins/uml/assistants/pom.xml | 24 + .../pom.xml | 4 +- .../pom.xml | 4 +- tests/junit/plugins/uml/decoratormodel/pom.xml | 23 + .../pom.xml | 5 +- .../pom.xml | 5 +- .../pom.xml | 5 +- .../pom.xml | 5 +- .../pom.xml | 5 +- .../pom.xml | 5 +- .../pom.xml | 5 +- .../pom.xml | 5 +- .../pom.xml | 5 +- .../pom.xml | 5 +- .../pom.xml | 5 +- .../pom.xml | 5 +- .../pom.xml | 5 +- .../pom.xml | 5 +- .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 +++++++ .../.settings/org.eclipse.jdt.ui.prefs | 68 ++ .../META-INF/MANIFEST.MF | 32 + .../Papyrus Diagram UML tests.launch | 45 ++ .../about.html | 28 + .../build.properties | 7 + .../plugin.properties | 12 + .../pom.xml | 56 ++ .../papyrus/uml/diagram/suite/tests/Activator.java | 54 ++ .../papyrus/uml/diagram/suite/tests/AllTests.java | 60 ++ .../org.eclipse.papyrus.uml.diagram.tests/pom.xml | 2 +- .../pom.xml | 5 +- .../pom.xml | 5 +- .../pom.xml | 5 +- tests/junit/plugins/uml/diagram/pom.xml | 10 +- .../pom.xml | 5 +- .../pom.xml | 5 +- .../junit/plugins/uml/internationalization/pom.xml | 14 +- .../pom.xml | 2 +- tests/junit/plugins/uml/modelexplorer/pom.xml | 22 + .../pom.xml | 5 +- .../pom.xml | 5 +- .../pom.xml | 7 +- .../pom.xml | 5 +- .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 +++++++ .../.settings/org.eclipse.jdt.ui.prefs | 68 ++ .../META-INF/MANIFEST.MF | 21 + .../Papyrus Nattable UML tests.launch | 45 ++ .../about.html | 28 + .../build.properties | 7 + .../plugin.properties | 12 + .../pom.xml | 56 ++ .../uml/nattable/suite/tests/Activator.java | 54 ++ .../papyrus/uml/nattable/suite/tests/AllTests.java | 51 ++ .../org.eclipse.papyrus.uml.nattable.tests/pom.xml | 5 +- tests/junit/plugins/uml/nattable/pom.xml | 20 +- .../org.eclipse.papyrus.search.tests/.classpath | 7 - .../uml/org.eclipse.papyrus.search.tests/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 295 ------- .../.settings/org.eclipse.jdt.ui.prefs | 68 -- .../META-INF/MANIFEST.MF | 13 - .../org.eclipse.papyrus.search.tests/about.html | 28 - .../build.properties | 7 - .../plugin.properties | 14 - .../uml/org.eclipse.papyrus.search.tests/pom.xml | 15 - .../papyrus/search/tests/suites/AllTests.java | 14 - .../pom.xml | 2 +- .../org.eclipse.papyrus.uml.filters.tests/pom.xml | 4 +- .../pom.xml | 2 +- .../org.eclipse.papyrus.uml.profile.tests/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../org.eclipse.papyrus.uml.suite.tests/.classpath | 7 + .../org.eclipse.papyrus.uml.suite.tests/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 +++++++ .../.settings/org.eclipse.jdt.ui.prefs | 68 ++ .../META-INF/MANIFEST.MF | 40 + .../Papyrus UML tests.launch | 45 ++ .../org.eclipse.papyrus.uml.suite.tests/about.html | 28 + .../build.properties | 7 + .../plugin.properties | 12 + .../org.eclipse.papyrus.uml.suite.tests/pom.xml | 56 ++ .../eclipse/papyrus/uml/suite/tests/Activator.java | 54 ++ .../eclipse/papyrus/uml/suite/tests/AllTests.java | 70 ++ tests/junit/plugins/uml/pom.xml | 44 ++ .../pom.xml | 4 +- tests/junit/plugins/uml/profile/pom.xml | 22 + .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 +++++++ .../.settings/org.eclipse.jdt.ui.prefs | 68 ++ .../META-INF/MANIFEST.MF | 21 + .../Papyrus Textedit tests.launch | 45 ++ .../about.html | 28 + .../build.properties | 7 + .../plugin.properties | 12 + .../pom.xml | 56 ++ .../uml/textedit/suite/tests/Activator.java | 54 ++ .../papyrus/uml/textedit/suite/tests/AllTests.java | 51 ++ .../org.eclipse.papyrus.uml.textedit.tests/pom.xml | 2 +- .../pom.xml | 2 +- tests/junit/plugins/uml/textedit/pom.xml | 26 + .../org.eclipse.papyrus.uml.tools.tests/pom.xml | 2 +- .../pom.xml | 2 +- tests/junit/plugins/uml/tools/pom.xml | 23 + .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- tests/junit/plugins/uml/validation/pom.xml | 24 + .../pom.xml | 2 +- .../.classpath | 7 + .../org.eclipse.papyrus.views.suite.tests/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 +++++++ .../.settings/org.eclipse.jdt.ui.prefs | 68 ++ .../META-INF/MANIFEST.MF | 19 + .../Papyrus Views ALL tests.launch | 45 ++ .../about.html | 28 + .../build.properties | 7 + .../plugin.properties | 12 + .../org.eclipse.papyrus.views.suite.tests/pom.xml | 56 ++ .../papyrus/views/suite/tests/Activator.java | 54 ++ .../papyrus/views/suite/tests/AllTests.java | 55 ++ tests/junit/plugins/views/pom.xml | 27 + .../pom.xml | 2 +- 875 files changed, 40779 insertions(+), 35933 deletions(-) delete mode 100644 tests/integration/plugins/org.eclipse.papyrus.integrationtests.editor/META-INF/MANIFEST.MF delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/.classpath delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/.project delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/META-INF/MANIFEST.MF delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/about.html delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/build.properties delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/table.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/table.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/table.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee-no-constraints.profile.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee.profile.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/library.di delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/library.notation delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/library.uml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/org.eclipse.papyrus.editor.integration.tests.launch delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/pom.xml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/Activator.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/AllTests.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/AbstractEditorIntegrationTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingMemoryLeakFixture.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingScenariosMemoryLeakTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorMemoryLeakTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorReloadTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/ModelSetTests.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/PageManagerTests.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/RecoveryTest.java delete mode 100755 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/.classpath delete mode 100755 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/.project delete mode 100755 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/.settings/org.eclipse.jdt.core.prefs delete mode 100755 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/.settings/org.eclipse.jdt.ui.prefs delete mode 100755 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/ClipboardTests.launch delete mode 100755 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/META-INF/MANIFEST.MF delete mode 100755 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/about.html delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/build.properties delete mode 100755 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.properties delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.xml delete mode 100755 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/pom.xml delete mode 100755 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AWTClipboardUtils.java delete mode 100755 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/Activator.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AllTests.java delete mode 100755 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/ClipboardTests.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/CopierFactoryTest.java delete mode 100755 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/SWTClipboardUtils.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.classpath delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.project delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/META-INF/MANIFEST.MF delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/OSGI-INF/l10n/bundle.properties delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/about.html delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/build.properties delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/org.eclipse.papyrus.sasheditor.di.tests.launch delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/pom.xml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/DiSashModelMngrTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/FakeModelFactory.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/AbstractDiContentProviderTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CheckVisitor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/ContentChangeListener.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CreateModelVisitor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProvider2Test.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderBaseVisitor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacade.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacadeTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/FakePageModelFactory.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/PageManagerImplTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/QueryVisitor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/SashContainerModels.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/TransactionalDiContentProvider2Test.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/AbstractSash.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CheckVisitor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CreateModelVisitor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Folder.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/HSash.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryExp.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryTerm.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryVisitor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/NoMatchException.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Page.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/PanelTerm.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryException.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryVisitor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQuery.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQueryTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/VSash.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/WindowTerm.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/tests/AllTests.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.classpath delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.project delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/META-INF/MANIFEST.MF delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/about.html delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/build.properties delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/org.eclipse.papyrus.infra.core.sasheditor.tests.launch delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.properties delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.xml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/pom.xml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/AbstractSashWindowContentProviderFacadeTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/IPageMngrTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/ISashWindowsContentProviderFacade.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/AllTests.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CheckVisitor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CreateModelInSimpleContentProviderVisitor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/FakePageModel.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/QueryVisitor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleContentProviderBaseVisitor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacade.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeCommonTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacade.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest2.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtils.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtilsTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowsContentProviderTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/AllTests.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/FakeEditorModel.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/MessagePartModel.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/SashMultiPageEditorTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/ShellEditor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/AllTests.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeFolderLifeCycleEventsListener.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakePageLifeCycleEventsListener.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakePagePart.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeTabFolderPart.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FolderLifeCycleEventsThrownFromContainerTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/PageLifeCycleEventsThrownFromContainerTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashContainerEventsProviderTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerDisposeCalledTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerMemoryLeakTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerRefreshTabsTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/TabFolderListManagerTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/AbstractSash.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/BadNameException.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Folder.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/HSash.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelExp.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelObject.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IPagesModelVisitor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NoMatchException.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NotFoundException.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Page.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PagesModelException.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PanelTerm.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModel.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModelFactory.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/VSash.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/WindowTerm.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/package-info.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/AllTests.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/AllTests.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInput.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInputTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditorTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TestTextEditor.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TextEditorPartModel.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/ISashWindowsContentProviderTestUtils.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/LeakingObject.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakUtil.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/NonLeakingObject.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/package-info.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/ITraceRecords.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/MultiValuesTraceRecord.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/NullTraceRecords.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/SimpleTraceRecord.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceLogger.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecord.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecords.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecordsFactory.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/FakeObservableListener.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/ObservableListTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/.classpath delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/.project delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/META-INF/MANIFEST.MF delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/about.html delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/build.properties delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/org.eclipse.papyrus.infra.core.tests.launch delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/plugin.properties delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/plugin.xml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/pom.xml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/resources/My.ecore delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/resources/My.genmodel delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/language/LanguageServiceTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractModelWithSharedResourceTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractResourceAdapterTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/Bug402525.ecore delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModel.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelManagerSnippet.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelWithSharedResource.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ModelSetTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/NestingTransactionalCommandStackTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTransactionalTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/TestTrace.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ComposedServiceTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedService.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePart.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartA.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartB.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeService.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeServiceFactory.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeWithRequiredServiceFactory.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA10.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceB.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceC.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicePojoA.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicesRegistryTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/SharedServiceFactoryTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/TestTrace.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/tests/AllTests.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/AdapterUtilsTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobBasedFutureTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobExecutorServiceTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/TransactionHelperTest.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/.classpath delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/.project delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/AllTestsWithMemoryDump.launch delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests - Failures.launch delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests With Coverage.launch delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests.launch delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus All Headless tests.launch delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus All UI tests.launch delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus Core tests (no SysML).launch delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus Generated Diagram Tests.launch delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus SysML tests With Coverage.launch delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus SysML tests.launch delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/about.html delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/build.properties delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/plugin.properties delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/pom.xml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/Activator.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllGenTests.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllHeadlessTests.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllUITests.java create mode 100755 tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/.classpath create mode 100755 tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/.project create mode 100755 tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/.settings/org.eclipse.jdt.core.prefs create mode 100755 tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100755 tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/META-INF/MANIFEST.MF create mode 100755 tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/Papyrus Developer ALL tests.launch create mode 100755 tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/about.html create mode 100755 tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/build.properties create mode 100755 tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/plugin.properties create mode 100755 tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/pom.xml create mode 100755 tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/test/org/eclipse/papyrus/developer/suite/tests/Activator.java create mode 100755 tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/test/org/eclipse/papyrus/developer/suite/tests/AllTests.java create mode 100755 tests/junit/plugins/developer/pom.xml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/.classpath create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/.project create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/.settings/org.eclipse.jdt.core.prefs create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/META-INF/MANIFEST.MF create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/about.html create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/build.properties create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/table.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/table.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/table.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee-no-constraints.profile.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee.profile.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/library.di create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/library.notation create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/library.uml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/org.eclipse.papyrus.editor.integration.tests.launch create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/pom.xml create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/Activator.java create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/AllTests.java create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/AbstractEditorIntegrationTest.java create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingMemoryLeakFixture.java create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingScenariosMemoryLeakTest.java create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorMemoryLeakTest.java create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorReloadTest.java create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/ModelSetTests.java create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/PageManagerTests.java create mode 100644 tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/RecoveryTest.java create mode 100755 tests/junit/plugins/editor/pom.xml create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.classpath create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.project create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.settings/org.eclipse.jdt.core.prefs create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/ClipboardTests.launch create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/META-INF/MANIFEST.MF create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/about.html create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/build.properties create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.properties create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.xml create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/pom.xml create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AWTClipboardUtils.java create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/Activator.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AllTests.java create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/ClipboardTests.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/CopierFactoryTest.java create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/SWTClipboardUtils.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.classpath create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.project create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.settings/org.eclipse.jdt.core.prefs create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/META-INF/MANIFEST.MF create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/OSGI-INF/l10n/bundle.properties create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/about.html create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/build.properties create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/org.eclipse.papyrus.sasheditor.di.tests.launch create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/pom.xml create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/DiSashModelMngrTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/FakeModelFactory.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/AbstractDiContentProviderTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CheckVisitor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/ContentChangeListener.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CreateModelVisitor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProvider2Test.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderBaseVisitor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacade.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacadeTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/FakePageModelFactory.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/PageManagerImplTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/QueryVisitor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/SashContainerModels.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/TransactionalDiContentProvider2Test.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/AbstractSash.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CheckVisitor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CreateModelVisitor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Folder.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/HSash.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryExp.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryTerm.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryVisitor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/NoMatchException.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Page.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/PanelTerm.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryException.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryVisitor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQuery.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQueryTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/VSash.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/WindowTerm.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/tests/AllTests.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.classpath create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.project create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.settings/org.eclipse.jdt.core.prefs create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/META-INF/MANIFEST.MF create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/about.html create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/build.properties create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/org.eclipse.papyrus.infra.core.sasheditor.tests.launch create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.properties create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.xml create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/pom.xml create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/AbstractSashWindowContentProviderFacadeTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/IPageMngrTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/ISashWindowsContentProviderFacade.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/AllTests.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CheckVisitor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CreateModelInSimpleContentProviderVisitor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/FakePageModel.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/QueryVisitor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleContentProviderBaseVisitor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacade.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeCommonTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacade.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest2.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtils.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtilsTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowsContentProviderTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/AllTests.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/FakeEditorModel.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/MessagePartModel.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/SashMultiPageEditorTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/ShellEditor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/AllTests.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeFolderLifeCycleEventsListener.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakePageLifeCycleEventsListener.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakePagePart.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeTabFolderPart.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FolderLifeCycleEventsThrownFromContainerTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/PageLifeCycleEventsThrownFromContainerTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashContainerEventsProviderTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerDisposeCalledTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerMemoryLeakTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerRefreshTabsTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/TabFolderListManagerTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/AbstractSash.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/BadNameException.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Folder.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/HSash.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelExp.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelObject.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IPagesModelVisitor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NoMatchException.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NotFoundException.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Page.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PagesModelException.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PanelTerm.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModel.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModelFactory.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/VSash.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/WindowTerm.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/package-info.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/AllTests.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/AllTests.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInput.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInputTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditorTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TestTextEditor.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TextEditorPartModel.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/ISashWindowsContentProviderTestUtils.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/LeakingObject.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakUtil.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/NonLeakingObject.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/package-info.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/ITraceRecords.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/MultiValuesTraceRecord.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/NullTraceRecords.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/SimpleTraceRecord.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceLogger.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecord.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecords.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecordsFactory.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/FakeObservableListener.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/ObservableListTest.java create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.classpath create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.project create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.settings/org.eclipse.jdt.core.prefs create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/META-INF/MANIFEST.MF create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/Papyrus Core tests.launch create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/about.html create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/build.properties create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/plugin.properties create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/pom.xml create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/test/org/eclipse/papyrus/infra/core/suite/tests/Activator.java create mode 100755 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/test/org/eclipse/papyrus/infra/core/suite/tests/AllTests.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/.classpath create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/.project create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/.settings/org.eclipse.jdt.core.prefs create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/META-INF/MANIFEST.MF create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/about.html create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/build.properties create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/org.eclipse.papyrus.infra.core.tests.launch create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/plugin.properties create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/plugin.xml create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/pom.xml create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/resources/My.ecore create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/resources/My.genmodel create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/language/LanguageServiceTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractModelWithSharedResourceTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractResourceAdapterTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/Bug402525.ecore create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModel.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelManagerSnippet.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelWithSharedResource.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ModelSetTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/NestingTransactionalCommandStackTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTransactionalTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/TestTrace.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ComposedServiceTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedService.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePart.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartA.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartB.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeService.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeServiceFactory.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeWithRequiredServiceFactory.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA10.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceB.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceC.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicePojoA.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicesRegistryTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/SharedServiceFactoryTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/TestTrace.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/tests/AllTests.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/AdapterUtilsTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobBasedFutureTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobExecutorServiceTest.java create mode 100644 tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/TransactionHelperTest.java create mode 100755 tests/junit/plugins/infra/core/pom.xml create mode 100755 tests/junit/plugins/infra/editor/pom.xml create mode 100755 tests/junit/plugins/infra/emf/pom.xml create mode 100755 tests/junit/plugins/infra/gmfdiag/pom.xml create mode 100755 tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.classpath create mode 100755 tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.project create mode 100755 tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.settings/org.eclipse.jdt.core.prefs create mode 100755 tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100755 tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/META-INF/MANIFEST.MF create mode 100755 tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/Papyrus Nattable Infra tests.launch create mode 100755 tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/about.html create mode 100755 tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/build.properties create mode 100755 tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/plugin.properties create mode 100755 tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/pom.xml create mode 100755 tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/test/org/eclipse/papyrus/infra/nattable/suite/tests/Activator.java create mode 100755 tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/test/org/eclipse/papyrus/infra/nattable/suite/tests/AllTests.java create mode 100755 tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/.classpath create mode 100755 tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/.project create mode 100755 tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/.settings/org.eclipse.jdt.core.prefs create mode 100755 tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100755 tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/META-INF/MANIFEST.MF create mode 100755 tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/Papyrus Infra tests.launch create mode 100755 tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/about.html create mode 100755 tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/build.properties create mode 100755 tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/plugin.properties create mode 100755 tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/pom.xml create mode 100755 tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/test/org/eclipse/papyrus/infra/suite/tests/Activator.java create mode 100755 tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/test/org/eclipse/papyrus/infra/suite/tests/AllTests.java create mode 100755 tests/junit/plugins/infra/pom.xml create mode 100755 tests/junit/plugins/infra/properties/pom.xml create mode 100755 tests/junit/plugins/infra/services/pom.xml create mode 100755 tests/junit/plugins/infra/types/pom.xml create mode 100755 tests/junit/plugins/infra/viewpoints/pom.xml create mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/.classpath create mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/.project create mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.core.prefs create mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF create mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/Papyrus ALL tests.launch create mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/about.html create mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/build.properties create mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/plugin.properties create mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/pom.xml create mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/Activator.java create mode 100644 tests/junit/plugins/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java create mode 100755 tests/junit/plugins/pom.xml delete mode 100644 tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/.classpath delete mode 100644 tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/.project delete mode 100644 tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/META-INF/MANIFEST.MF delete mode 100644 tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/Papyrus Diagram Assistants tests.launch delete mode 100644 tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/about.html delete mode 100644 tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/build.properties delete mode 100644 tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/documentation.pdoc delete mode 100644 tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/plugin.properties delete mode 100644 tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/pom.xml delete mode 100644 tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/src/org/eclipse/papyrus/tests/diagramassistants/AllTests.java create mode 100755 tests/junit/plugins/uml/alf/pom.xml create mode 100755 tests/junit/plugins/uml/assistants/pom.xml create mode 100755 tests/junit/plugins/uml/decoratormodel/pom.xml create mode 100755 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.classpath create mode 100755 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.project create mode 100755 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.settings/org.eclipse.jdt.core.prefs create mode 100755 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100755 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/META-INF/MANIFEST.MF create mode 100755 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/Papyrus Diagram UML tests.launch create mode 100755 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/about.html create mode 100755 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/build.properties create mode 100755 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/plugin.properties create mode 100755 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/pom.xml create mode 100755 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/test/org/eclipse/papyrus/uml/diagram/suite/tests/Activator.java create mode 100755 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/test/org/eclipse/papyrus/uml/diagram/suite/tests/AllTests.java create mode 100755 tests/junit/plugins/uml/modelexplorer/pom.xml create mode 100755 tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.classpath create mode 100755 tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.project create mode 100755 tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.settings/org.eclipse.jdt.core.prefs create mode 100755 tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100755 tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/META-INF/MANIFEST.MF create mode 100755 tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/Papyrus Nattable UML tests.launch create mode 100755 tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/about.html create mode 100755 tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/build.properties create mode 100755 tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/plugin.properties create mode 100755 tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/pom.xml create mode 100755 tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/test/org/eclipse/papyrus/uml/nattable/suite/tests/Activator.java create mode 100755 tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/test/org/eclipse/papyrus/uml/nattable/suite/tests/AllTests.java delete mode 100644 tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/.classpath delete mode 100644 tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/.project delete mode 100644 tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/META-INF/MANIFEST.MF delete mode 100644 tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/about.html delete mode 100644 tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/build.properties delete mode 100644 tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/plugin.properties delete mode 100644 tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/pom.xml delete mode 100644 tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/src/org/eclipse/papyrus/search/tests/suites/AllTests.java create mode 100755 tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/.classpath create mode 100755 tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/.project create mode 100755 tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/.settings/org.eclipse.jdt.core.prefs create mode 100755 tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100755 tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/META-INF/MANIFEST.MF create mode 100755 tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/Papyrus UML tests.launch create mode 100755 tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/about.html create mode 100755 tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/build.properties create mode 100755 tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/plugin.properties create mode 100755 tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/pom.xml create mode 100755 tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/test/org/eclipse/papyrus/uml/suite/tests/Activator.java create mode 100755 tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/test/org/eclipse/papyrus/uml/suite/tests/AllTests.java create mode 100755 tests/junit/plugins/uml/pom.xml create mode 100755 tests/junit/plugins/uml/profile/pom.xml create mode 100755 tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.classpath create mode 100755 tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.project create mode 100755 tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.settings/org.eclipse.jdt.core.prefs create mode 100755 tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100755 tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/META-INF/MANIFEST.MF create mode 100755 tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/Papyrus Textedit tests.launch create mode 100755 tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/about.html create mode 100755 tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/build.properties create mode 100755 tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/plugin.properties create mode 100755 tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/pom.xml create mode 100755 tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/test/org/eclipse/papyrus/uml/textedit/suite/tests/Activator.java create mode 100755 tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/test/org/eclipse/papyrus/uml/textedit/suite/tests/AllTests.java create mode 100755 tests/junit/plugins/uml/textedit/pom.xml create mode 100755 tests/junit/plugins/uml/tools/pom.xml create mode 100755 tests/junit/plugins/uml/validation/pom.xml create mode 100755 tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/.classpath create mode 100755 tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/.project create mode 100755 tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/.settings/org.eclipse.jdt.core.prefs create mode 100755 tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/.settings/org.eclipse.jdt.ui.prefs create mode 100755 tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/META-INF/MANIFEST.MF create mode 100755 tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/Papyrus Views ALL tests.launch create mode 100755 tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/about.html create mode 100755 tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/build.properties create mode 100755 tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/plugin.properties create mode 100755 tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/pom.xml create mode 100755 tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/test/org/eclipse/papyrus/views/suite/tests/Activator.java create mode 100755 tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/test/org/eclipse/papyrus/views/suite/tests/AllTests.java create mode 100755 tests/junit/plugins/views/pom.xml (limited to 'tests') diff --git a/tests/integration/plugins/org.eclipse.papyrus.integrationtests.editor/META-INF/MANIFEST.MF b/tests/integration/plugins/org.eclipse.papyrus.integrationtests.editor/META-INF/MANIFEST.MF deleted file mode 100644 index 1db4c5cb885..00000000000 --- a/tests/integration/plugins/org.eclipse.papyrus.integrationtests.editor/META-INF/MANIFEST.MF +++ /dev/null @@ -1,30 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.papyrus.infra.core;bundle-version="1.2.0", - org.eclipse.ui.workbench, - org.eclipse.ui.ide, - org.eclipse.emf.ecore;bundle-version="2.9.1", - org.junit;bundle-version="4.10.0", - org.eclipse.papyrus.uml.tools;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.clazz;bundle-version="1.2.0", - org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.2.0", - org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="[3.0.0,4.0.0)", - org.eclipse.papyrus.uml.diagram.activity;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.emftree;bundle-version="1.2.0", - org.eclipse.papyrus.infra.emf.diagram.common;bundle-version="1.2.0", - org.eclipse.core.commands;bundle-version="3.6.100", - org.eclipse.emf.transaction;bundle-version="1.4.0", - org.eclipse.papyrus.infra.ui;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.2.0" -Export-Package: org.eclipse.papyrus.integrationtests.editor -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.integrationtests.editor.Activator -Bundle-SymbolicName: org.eclipse.papyrus.integrationtests.editor -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/.classpath b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/.classpath deleted file mode 100644 index 2d1a4302f04..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/.project b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/.project deleted file mode 100644 index 7c626a1bed6..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.editor.integration.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/core/org.eclipse.papyrus.editor.integration.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 4759947300a..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.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.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 -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/core/org.eclipse.papyrus.editor.integration.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.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/core/org.eclipse.papyrus.editor.integration.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/META-INF/MANIFEST.MF deleted file mode 100644 index b5cfb384cf8..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,47 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.papyrus.infra.core;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.clazz;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.timing;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", - org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="[3.0.0,4.0.0)", - org.eclipse.gmf.runtime.notation;bundle-version="1.5.0", - org.eclipse.papyrus.uml.tools;bundle-version="1.2.0", - org.eclipse.uml2.uml;bundle-version="4.1.0", - org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0", - org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.2.0", - org.eclipse.ui.ide;bundle-version="3.9.0", - org.eclipse.emf.transaction;bundle-version="1.4.0", - org.eclipse.gmf.runtime.common.core;bundle-version="1.7.0", - org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.7.0", - org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0", - org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.7.0", - org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="1.7.0", - org.eclipse.papyrus.infra.services.edit;bundle-version="1.2.0", - org.junit;bundle-version="4.10.0", - org.eclipse.papyrus.views.modelexplorer;bundle-version="1.2.0", - org.eclipse.ui.navigator;bundle-version="3.5.0", - org.eclipse.papyrus.infra.services.validation;bundle-version="1.2.0", - org.eclipse.papyrus.uml.service.validation;bundle-version="1.2.0", - com.google.guava;bundle-version="11.0.0", - org.eclipse.papyrus.infra.nattable.common;bundle-version="1.2.0", - org.eclipse.papyrus.infra.nattable;bundle-version="1.2.0", - org.eclipse.papyrus.uml.nattable.menu;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.sequence;bundle-version="1.2.0", - org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", - org.eclipse.papyrus.junit.framework;bundle-version="1.2.0", - org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", - org.eclipse.papyrus.infra.ui;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="1.2.0" -Export-Package: org.eclipse.papyrus.editor.integration.tests, - org.eclipse.papyrus.editor.integration.tests.tests -Bundle-Vendor: Eclipse Modeling Project -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Name: Papyrus Editor Integration Tests -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.editor.integration.tests.Activator -Bundle-SymbolicName: org.eclipse.papyrus.editor.integration.tests -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/about.html b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.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/core/org.eclipse.papyrus.editor.integration.tests/build.properties b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/build.properties deleted file mode 100644 index 946edb23c31..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - model/ -src.includes = about.html diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.di deleted file mode 100644 index c25cf0e5223..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.di +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.notation deleted file mode 100644 index 8a856b7d0aa..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.notation +++ /dev/null @@ -1,578 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - -
-
- - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.uml deleted file mode 100644 index 0c842d67110..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.uml +++ /dev/null @@ -1,178 +0,0 @@ - - - - Complex model with many pages and a specific layout - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - State 1 - - - - - - - - -
- - - - State 2 - - - - - - - - -
- - - - State 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - State 1 - - - - - - - - -
- - - - State 3 - - - - - - - - -
- - - - State 2 - - - - - - - - -
- - - - State 1 - - - - - - - - -
- - - - State 3 - - - - - -
- - -
-
- - - - -
- - - - -
- - -
-
-
- - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.di deleted file mode 100644 index f1f92bb0083..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.di +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.notation deleted file mode 100644 index 09c604d50e0..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.notation +++ /dev/null @@ -1,282 +0,0 @@ - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.uml deleted file mode 100644 index b535fe817da..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.uml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.di deleted file mode 100644 index 2c53cfcf529..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.di +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.notation deleted file mode 100644 index 8e19ab5e0ce..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.notation +++ /dev/null @@ -1,666 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.uml deleted file mode 100644 index ca30b5e89de..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.uml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.di deleted file mode 100644 index 1fcb63b602c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.di +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.notation deleted file mode 100644 index f69e268e509..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.notation +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.uml deleted file mode 100644 index 7aa02902acd..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.uml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.di deleted file mode 100644 index 67cd21c0e77..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.di +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.notation deleted file mode 100644 index 8634d4c00e0..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.notation +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.uml deleted file mode 100644 index 5ec8003b419..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.uml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.di deleted file mode 100644 index f3567829b33..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.di +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.notation deleted file mode 100644 index ecef23e3362..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.notation +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.uml deleted file mode 100644 index 6df52ae038f..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.uml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.di deleted file mode 100644 index 0dd660346e0..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.di +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.notation deleted file mode 100644 index 8634d4c00e0..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.notation +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.uml deleted file mode 100644 index 81b5d6837d8..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.uml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.di deleted file mode 100644 index 3db5ff676fa..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.di +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.notation deleted file mode 100644 index 2b17a5a95b8..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.notation +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.uml deleted file mode 100644 index 7e87e564867..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.uml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/table.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/table.di deleted file mode 100644 index 0eab39cbb9c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/table.di +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/table.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/table.notation deleted file mode 100644 index 8ce107d34ff..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/table.notation +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/table.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/table.uml deleted file mode 100644 index 715500c8abc..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/table.uml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.di deleted file mode 100644 index 9df9758558f..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.di +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.notation deleted file mode 100644 index bae83b041b3..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.notation +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.uml deleted file mode 100644 index bddffd2337e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.uml +++ /dev/null @@ -1,12 +0,0 @@ - - - - This model contains two diagrams. The Class Diagram is opened, while the timing diagram is closed. - -Expected behavior: - - - allPages() contains two entries - - activeEditor is a UML Class Diagram Editor - - activePage() is a Class Diagram - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.di deleted file mode 100644 index 90a18ab0720..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.di +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.notation deleted file mode 100644 index 1edb6f4bc90..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.notation +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.uml deleted file mode 100644 index 10dab39ad2c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.uml +++ /dev/null @@ -1,13 +0,0 @@ - - - - This model contains two tables. The Generic Table is opened, while the table of views is closed. -Expected behavior: -- allPages() contains two entries -- activeEditor is a UML Generic Table Editor Editor -- activePage() is a Generic Table - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.di deleted file mode 100644 index 6973c8a48a6..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.di +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.notation deleted file mode 100644 index d8bec030baf..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.notation +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.uml deleted file mode 100644 index cac8a57cf98..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.uml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.di deleted file mode 100644 index bf9abab340f..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.di +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.notation deleted file mode 100644 index 50f74c0a930..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.notation +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.uml deleted file mode 100644 index c4c95eda8ff..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.uml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.di deleted file mode 100644 index 7911915cf04..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.di +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.notation deleted file mode 100644 index 6c0abe64f07..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.notation +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.uml deleted file mode 100644 index 63f2a148ad3..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.uml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee-no-constraints.profile.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee-no-constraints.profile.uml deleted file mode 100644 index ba4a69ee274..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee-no-constraints.profile.uml +++ /dev/null @@ -1,252 +0,0 @@ - - - - - -
- - -
-
-
-
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OCL - base_Property - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OCL - Set{base_Class, base_Interface}->excludingNull()->any(true) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee.profile.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee.profile.uml deleted file mode 100644 index 2ecfb621eb5..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee.profile.uml +++ /dev/null @@ -1,317 +0,0 @@ - - - - - -
-
- - -
-
-
-
-
- - - - - -
- - - - - - - - - - - - - - -
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OCL - base_Property - - - - - - - - - - - - - - - - - - - - - - - - OCL - getBaseElement().name <> null - - - - - - - - - - - - - - - - - - - - - - - OCL - true - - - - - - - - - - - - - - - - - - OCL - Set{base_Class, base_Interface}->excludingNull()->any(true) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.di deleted file mode 100644 index 571f53ee13f..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.di +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.notation deleted file mode 100644 index d98e9c7cb2f..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.notation +++ /dev/null @@ -1,71 +0,0 @@ - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.uml deleted file mode 100644 index 9891f8006a8..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.uml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - gold - p1 - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model.di deleted file mode 100644 index 3f8c9b9d256..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model.di +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model.notation deleted file mode 100644 index 9482a3e63b3..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model.notation +++ /dev/null @@ -1,71 +0,0 @@ - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model.uml deleted file mode 100644 index 42136560022..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/profile/model.uml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - gold - p1 - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.di deleted file mode 100644 index 393779dd390..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.di +++ /dev/null @@ -1,407 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.notation deleted file mode 100644 index 5d4522a3554..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.notation +++ /dev/null @@ -1,560 +0,0 @@ - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.uml deleted file mode 100644 index 9f7acb3777b..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.uml +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - -
- - - - State 1 - - - - - - - - -
- - - - State 2 - - - - - - - - -
- - - - State 1 - - - - - - - - -
- - - - State 2 - - - - - -
- - - - State 1 - - - - - - - - -
- - - - State 1 - - - - - - - - -
- - - - State 1 - - - - - - - - -
- - - - State 1 - - - - - -
- - -
-
- - - - -
- - -
- - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.di deleted file mode 100644 index 5779ff3e03e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.di +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.notation deleted file mode 100644 index ad0a78dcaf1..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.notation +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.uml deleted file mode 100644 index 1b5e21d1129..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.uml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.di deleted file mode 100644 index da40187324e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.di +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.notation deleted file mode 100644 index 987e8519d88..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.notation +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.uml deleted file mode 100644 index 3fb29cbb21f..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.uml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.di deleted file mode 100644 index ff276f9cd63..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.di +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.notation deleted file mode 100644 index 5cb52265c3d..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.notation +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.uml deleted file mode 100644 index eed0ddaa469..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.uml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.di deleted file mode 100644 index 57c4cacd79a..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.di +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.notation deleted file mode 100644 index 8b06128a92a..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.notation +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.uml deleted file mode 100644 index e66e282062a..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.uml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.di deleted file mode 100644 index ca1bbab7d32..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.di +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.notation deleted file mode 100644 index 25489bba383..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.notation +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.uml deleted file mode 100644 index f3af34a067d..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.uml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.di deleted file mode 100644 index a11b4af9890..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.di +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.notation deleted file mode 100644 index cf16a51643e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.notation +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.uml deleted file mode 100644 index 9832a801e19..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.uml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.di deleted file mode 100644 index db3312a6d7a..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.di +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.notation deleted file mode 100644 index 7a00061ce0e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.notation +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.uml deleted file mode 100644 index aa426b736e7..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.uml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.di deleted file mode 100644 index d94f1fa4ed4..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.di +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.notation deleted file mode 100644 index 16e458be63e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.notation +++ /dev/null @@ -1,415 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.uml deleted file mode 100644 index 4ff766e905a..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.uml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.di deleted file mode 100644 index 68491525f92..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.di +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.notation deleted file mode 100644 index a80718a7ca7..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.notation +++ /dev/null @@ -1,415 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.uml deleted file mode 100644 index 4ff766e905a..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.uml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/library.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/library.di deleted file mode 100644 index 42ec9bffb56..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/library.di +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/library.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/library.notation deleted file mode 100644 index 97b9536a1e0..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/library.notation +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/library.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/library.uml deleted file mode 100644 index 06f7daf5a6a..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/reload/library.uml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/org.eclipse.papyrus.editor.integration.tests.launch b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/org.eclipse.papyrus.editor.integration.tests.launch deleted file mode 100644 index 53fb6cee559..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/org.eclipse.papyrus.editor.integration.tests.launch +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/pom.xml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/pom.xml deleted file mode 100644 index 8099fd490fc..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.tests.releng - 1.2.0-SNAPSHOT - ../../../../../releng/main-tests - - org.eclipse.papyrus - org.eclipse.papyrus.editor.integration.tests - 1.2.0-SNAPSHOT - eclipse-test-plugin - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/Activator.java b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/Activator.java deleted file mode 100644 index 24f922e413c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/Activator.java +++ /dev/null @@ -1,76 +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.editor.integration.tests; - -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.editor.integration.tests"; //$NON-NLS-1$ - - /** - * The shared instance - */ - private static Activator plugin; - - /** - * The Log helper for this plug-in - */ - public static LogHelper log; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - log = new LogHelper(this); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @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; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/AllTests.java deleted file mode 100644 index 627ff0c83b0..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/AllTests.java +++ /dev/null @@ -1,41 +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 422257 - * Christian W. Damus (CEA) - bug 432813 - * Christian W. Damus (CEA) - bug 437217 - * - *****************************************************************************/ -package org.eclipse.papyrus.editor.integration.tests; - -import org.eclipse.papyrus.editor.integration.tests.tests.EditingScenariosMemoryLeakTest; -import org.eclipse.papyrus.editor.integration.tests.tests.EditorMemoryLeakTest; -import org.eclipse.papyrus.editor.integration.tests.tests.EditorReloadTest; -import org.eclipse.papyrus.editor.integration.tests.tests.ModelSetTests; -import org.eclipse.papyrus.editor.integration.tests.tests.PageManagerTests; -import org.eclipse.papyrus.editor.integration.tests.tests.RecoveryTest; -import org.junit.runner.RunWith; -import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; -import org.junit.runners.Suite.SuiteClasses; - - -/** - * The {@link EditorMemoryLeakTest} suite must run first, because some test case in one of the other suites - * breaks the Outline view: it causes a pair of Overview/Outline actions from some diagram editor to linger in - * the outline view's toolbar even after the editor was closed, and these persistent actions cause leaks of - * models opened later. - */ -@RunWith(ClassificationSuite.class) -@SuiteClasses({ EditorMemoryLeakTest.class, EditingScenariosMemoryLeakTest.class, // -PageManagerTests.class, RecoveryTest.class, ModelSetTests.class, // -EditorReloadTest.class }) -public class AllTests { - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/AbstractEditorIntegrationTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/AbstractEditorIntegrationTest.java deleted file mode 100644 index 3dc26b39d77..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/AbstractEditorIntegrationTest.java +++ /dev/null @@ -1,26 +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.editor.integration.tests.tests; - -import org.eclipse.papyrus.editor.integration.tests.Activator; -import org.eclipse.papyrus.junit.utils.tests.AbstractEditorTest; -import org.osgi.framework.Bundle; - - -public abstract class AbstractEditorIntegrationTest extends AbstractEditorTest { - - @Override - protected Bundle getBundle() { - return Activator.getDefault().getBundle(); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingMemoryLeakFixture.java b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingMemoryLeakFixture.java deleted file mode 100644 index a406ceb41ba..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingMemoryLeakFixture.java +++ /dev/null @@ -1,197 +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 483721 - * - */ -package org.eclipse.papyrus.editor.integration.tests.tests; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -import java.util.Collections; - -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gef.commands.Command; -import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; -import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack; -import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; -import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramEditDomain; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper; -import org.eclipse.papyrus.infra.core.utils.AdapterUtils; -import org.eclipse.papyrus.junit.utils.Duck; -import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.part.ISetSelectionTarget; -import org.junit.Rule; -import org.junit.rules.TestWatcher; -import org.junit.runner.Description; -import org.junit.runners.model.Statement; - - -/** - * A convenience fixture-rule for working with diagram editors in memory-leak test cases. It wraps a {@link PapyrusEditorFixture}, - * which must not be tagged a an {@link Rule @Rule} in its own right, because this fixture rule ensures that it decorates - * the test with the appropriate precedence. - */ -class EditingMemoryLeakFixture extends TestWatcher { - - static final String PROPERTY_SHEET = "org.eclipse.ui.views.PropertySheet"; - - static final String OUTLINE = "org.eclipse.ui.views.ContentOutline"; - - static final String PROJECT_EXPLORER = "org.eclipse.ui.navigator.ProjectExplorer"; - - static final String PACKAGE_EXPLORER = "org.eclipse.jdt.ui.PackageExplorer"; - - private final PapyrusEditorFixture editor; - - EditingMemoryLeakFixture(PapyrusEditorFixture editor) { - super(); - - this.editor = editor; - } - - public void selectModelInModelExplorer() { - // Select the Model element - editor.getModelExplorerView().revealSemanticElement(Collections.singletonList(editor.getModel())); - editor.flushDisplayEvents(); - } - - public void closeEditor() { - editor.close(); - - // now, open a new editor and close it to ensure that views such as Model Explorer, Outline, etc. get - // a new model into context and forget the previous - editor.open("model/basic/empty_model.di"); // This will be closed automatically when finished - selectModelInModelExplorer(); - - editor.getView(PROPERTY_SHEET, true); - editor.getView(OUTLINE, true); - - // Select something in the Project Explorer to flush the last model selection from the Properties view's default page - selectProjectInProjectExplorer(); - - editor.getView(PROPERTY_SHEET, true); - editor.getView(OUTLINE, true); - - editor.activate(); - } - - public IEditorPart getActiveEditor() { - return editor.getEditor().getActiveEditor(); - } - - public DiagramEditor getDiagramEditor() { - return AdapterUtils.adapt(getActiveEditor(), DiagramEditor.class, null); - } - - public DiagramEditPart getDiagramEditPart() { - return AdapterUtils.adapt(getDiagramEditor(), DiagramEditPart.class, null); - } - - public IDiagramEditDomain getEditDomain() { - return getDiagramEditor().getDiagramEditDomain(); - } - - public TransactionalEditingDomain getEditingDomain() { - TransactionalEditingDomain result = null; - - // Is the active inner editor a diagram editor? - DiagramEditor diagram = getDiagramEditor(); - if (diagram != null) { - result = diagram.getEditingDomain(); - } - - if (result == null) { - // Maybe it's a table editor - IEditorPart active = getActiveEditor(); - if (active != null) { - result = new Duck(active).quackp("get.+", TransactionalEditingDomain.class); - } - } - - if (result == null) { - // Fall back to the outer editor - result = editor.getEditingDomain(); - } - - return result; - } - - public CommandStack getCommandStack() { - return getEditingDomain().getCommandStack(); - } - - public DiagramCommandStack getDiagramCommandStack() { - return getEditDomain().getDiagramCommandStack(); - } - - public void execute(Command command) { - execute(GEFtoEMFCommandWrapper.wrap(command)); - } - - public void execute(org.eclipse.emf.common.command.Command command) { - final CommandStack stack = getCommandStack(); - - stack.execute(command); - - editor.flushDisplayEvents(); - - assertThat("Command execution failed. Checked the workspace log for details.", stack.getUndoCommand(), is(command)); - } - - public void selectProjectInProjectExplorer() { - ISetSelectionTarget projectExplorer = getProjectOrPackageExplorer(); - projectExplorer.selectReveal(new StructuredSelection(editor.getProject().getProject())); - editor.flushDisplayEvents(); - } - - ISetSelectionTarget getProjectOrPackageExplorer() { - ISetSelectionTarget result = null; - - IViewPart explorer = editor.getView(PROJECT_EXPLORER, false); - if (explorer == null) { - // Maybe we're in the Java perspective - explorer = editor.getView(PACKAGE_EXPLORER, false); - if (explorer == null) { - // Force the Project Explorer, then - explorer = editor.getView(PROJECT_EXPLORER, true); - } - } - - result = (ISetSelectionTarget) explorer; - - return result; - } - - // - // Test lifecycle - // - - @Override - public Statement apply(Statement base, Description description) { - return editor.apply(super.apply(base, description), description); - } - - @Override - protected void starting(Description description) { - editor.ensurePapyrusPerspective(); - selectModelInModelExplorer(); - } - - @Override - protected void finished(Description description) { - closeEditor(); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingScenariosMemoryLeakTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingScenariosMemoryLeakTest.java deleted file mode 100644 index 651e20ec554..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingScenariosMemoryLeakTest.java +++ /dev/null @@ -1,162 +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 433206 - * - */ -package org.eclipse.papyrus.editor.integration.tests.tests; - -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.gef.commands.Command; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; -import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper; -import org.eclipse.papyrus.infra.nattable.common.editor.NatTableEditor; -import org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager; -import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager; -import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; -import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; -import org.eclipse.papyrus.junit.framework.classification.rules.MemoryLeakRule; -import org.eclipse.papyrus.junit.framework.classification.rules.MemoryLeakRule.SoftReferenceSensitive; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram; -import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture; -import org.eclipse.papyrus.junit.utils.rules.PluginResource; -import org.eclipse.papyrus.uml.diagram.clazz.providers.UMLElementTypes; -import org.eclipse.papyrus.uml.nattable.menu.util.TableMenuUtils; -import org.eclipse.ui.IEditorPart; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Enumeration; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.UMLPackage; -import org.junit.Rule; -import org.junit.Test; - - -/** - * Test cases checking slightly more complex editing scenarios for leaks of user models. - */ -@PluginResource("model/basic/simple_class_model.di") -public class EditingScenariosMemoryLeakTest extends AbstractPapyrusTest { - - @Rule - public final MemoryLeakRule memory = new MemoryLeakRule(); - - private final PapyrusEditorFixture editor = new PapyrusEditorFixture(); - - @Rule - public final EditingMemoryLeakFixture fixture = new EditingMemoryLeakFixture(editor); - - public EditingScenariosMemoryLeakTest() { - super(); - } - - /** - * Verify that models do not leak when closing the editor after creating a new element. - */ - @Test - @SoftReferenceSensitive - public void testCreateNewElement() { - memory.add(editor.getModel()); - - CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(UMLElementTypes.Class_Shape, fixture.getDiagramEditPart().getDiagramPreferencesHint()); - Command command = fixture.getDiagramEditPart().getCommand(requestcreation); - fixture.execute(command); - } - - /** - * Verify that models do not leak when closing the editor after creating a new element in a table. - */ - @Test - @SoftReferenceSensitive - @PluginResource("model/basic/table.di") - public void testCreateNewElement_table() { - memory.add(editor.getModel()); - - // The TableMenuUtils needs the table-editor to be active - editor.activate(); - - IEditorPart tableEditor = fixture.getActiveEditor(); - assertThat("Not a table editor", tableEditor, instanceOf(NatTableEditor.class)); - INattableModelManager manager = (INattableModelManager) tableEditor.getAdapter(INattableModelManager.class); - assertThat(manager, notNullValue()); - IAxisManager axisManager = manager.getRowAxisManager(); - final int originalAxisSize = axisManager.getAllManagedAxis().size(); - - fixture.execute(getCreateClassInTableCommand()); - - // Verify that the element was added - int newAxisSize = axisManager.getAllManagedAxis().size(); - assertThat("Class not added to table", newAxisSize > originalAxisSize); - - // Close the editor and open it again, to force actions etc. to forget the previous selection - editor.close(); - editor.open(); - fixture.selectModelInModelExplorer(); - - // Do another edit ... - try { - fixture.execute(getCreateClassInTableCommand()); - } catch (AssertionError failure) { - // Doesn't matter to our purposes - } - } - - /** - * Verify that diagrams having active canonical edit policies do not cause leaks. - */ - @Test - @SoftReferenceSensitive - @PluginResource("model/canonical/css_leaktest.di") - @ActiveDiagram("main") - public void testCanonicalEditPolicy_bug433206() { - memory.add(editor.getModel()); - memory.add(editor.getActiveDiagramEditor().getDiagram()); - - // Cause some views to be created canonically - editor.getEditingDomain().getCommandStack().execute(new RecordingCommand(editor.getEditingDomain()) { - - @Override - protected void doExecute() { - final Package model = editor.getModel(); - - final Class class1 = (Class) model.getOwnedType("Class1"); - class1.createOwnedAttribute("name", null); - class1.createOwnedOperation("doIt", null, null); - class1.createNestedClassifier("nested", UMLPackage.Literals.PRIMITIVE_TYPE); - - final Enumeration enum1 = (Enumeration) model.getOwnedType("Enumeration1"); - enum1.createOwnedLiteral("one"); - enum1.createOwnedLiteral("two"); - - final Package package1 = model.getNestedPackage("Package1"); - package1.createOwnedClass("Foo", false); - } - }); - editor.flushDisplayEvents(); - - } - - // - // Test framework - // - - org.eclipse.emf.common.command.Command getCreateClassInTableCommand() { - CreateElementRequest request = new CreateElementRequest(fixture.getEditingDomain(), editor.getModel(), UMLElementTypes.Class_Shape); - IElementEditService edit = ElementEditServiceUtils.getCommandProvider(editor.getModel()); - org.eclipse.emf.common.command.Command create = GMFtoEMFCommandWrapper.wrap(edit.getEditCommand(request)); - return TableMenuUtils.buildNattableCreationCommand(create, request); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorMemoryLeakTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorMemoryLeakTest.java deleted file mode 100644 index 899a2bf8cf6..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorMemoryLeakTest.java +++ /dev/null @@ -1,202 +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 485214, 474467 - * - */ -package org.eclipse.papyrus.editor.integration.tests.tests; - -import static org.eclipse.papyrus.editor.integration.tests.tests.EditingMemoryLeakFixture.PROPERTY_SHEET; -import static org.junit.Assert.fail; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.ecore.EGenericType; -import org.eclipse.emf.ecore.ETypedElement; -import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; -import org.eclipse.papyrus.infra.services.validation.commands.ValidateModelCommand; -import org.eclipse.papyrus.junit.framework.classification.rules.MemoryLeakRule; -import org.eclipse.papyrus.junit.framework.classification.rules.MemoryLeakRule.SoftReferenceSensitive; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture; -import org.eclipse.papyrus.junit.utils.rules.PluginResource; -import org.junit.Rule; -import org.junit.Test; - - -/** - * Test cases checking that various different scenarios in the Papyrus Editor don't lead to memory leaks after the editor has been closed. - */ -@PluginResource("model/basic/simple_class_model.di") -public class EditorMemoryLeakTest extends AbstractPapyrusTest { - - @Rule - public final MemoryLeakRule memory = new MemoryLeakRule(); - - private final PapyrusEditorFixture editor = new PapyrusEditorFixture(); - - @Rule - public final EditingMemoryLeakFixture fixture = new EditingMemoryLeakFixture(editor); - - public EditorMemoryLeakTest() { - super(); - } - - /** - * Verify that the Model Set does not leak when closing the editor. - */ - @Test - public void testModelSetDoesNotLeak() { - memory.add(editor.getModelSet()); - } - - /** - * Verify that the UML Model content in the Model Explorer does not leak when closing the editor. - */ - @Test - @SoftReferenceSensitive - public void testModelExplorerContentDoesNotLeak() { - memory.add(editor.getModel()); - } - - /** - * Verify that diagram view parts do not leak when closing the editor. - */ - @Test - @SoftReferenceSensitive - public void testDiagramContentDoesNotLeak() { - DiagramEditor diagramEditor = (DiagramEditor) editor.getEditor().getActiveEditor(); - memory.add(diagramEditor.getDiagramEditPart()); - } - - /** - * Verify that the property sheet does not leak models when closing the editor. - */ - @Test - @SoftReferenceSensitive - public void testPropertySheetContentDoesNotLeak() { - // Activate the Properties view - editor.getView(PROPERTY_SHEET, true); - - // Select the Model element to show it in the Properties - fixture.selectModelInModelExplorer(); - - // Back to the Properties view - editor.getView(PROPERTY_SHEET, false); - - memory.add(editor.getModel()); - } - - /** - * Verify that models with dynamic profiles applied (and the profiles and everything else) don't leak when the editor is closed - * (the case of profiles that do not have OCL constraints and, therefore, do not have {@link ETypedElement}s of {@link EGenericType} type). - */ - @Test - @SoftReferenceSensitive - @PluginResource("model/profile/model-no-j2ee-constraints.di") - public void testProfileContentDoesNotLeak_noEGenericTypes() { - // Activate the Properties view - editor.getView(PROPERTY_SHEET, true); - - // Select the Model element to show it in the Properties - fixture.selectModelInModelExplorer(); - - // Back to the Properties view - editor.getView(PROPERTY_SHEET, false); - - memory.add(editor.getModel()); - memory.add(editor.getModel().getAppliedProfile("j2ee")); - } - - /** - * Verify that models with dynamic profiles applied (and the profiles and everything else) don't leak when when validation is run on them - * (the case of profiles that do not have OCL constraints and, therefore, do not have {@link ETypedElement}s of {@link EGenericType} type). - */ - @Test - @SoftReferenceSensitive - @PluginResource("model/profile/model-no-j2ee-constraints.di") - public void testValidatedProfiledModelContentDoesNotLeak_noEGenericTypes() { - // Validate the model - try { - new ValidateModelCommand(editor.getModel()).execute(new NullProgressMonitor(), null); - } catch (ExecutionException e) { - e.printStackTrace(); - fail("Failed to validate model: " + e.getLocalizedMessage()); - } - - // The validation command activated the Model Validation view. Return to Properties - editor.getView(PROPERTY_SHEET, false); - - editor.flushDisplayEvents(); - - memory.add(editor.getModel()); - memory.add(editor.getModel().getAppliedProfile("j2ee")); - } - - /** - * Verify that models with dynamic profiles applied (and the profiles and everything else) don't leak when the editor is closed - * (the case of profiles that have OCL constraints and, therefore, do have {@link ETypedElement}s of {@link EGenericType} type). - */ - @Test - @SoftReferenceSensitive - @PluginResource("model/profile/model.di") - public void testProfileContentDoesNotLeak() { - // Activate the Properties view - editor.getView(PROPERTY_SHEET, true); - - // Select the Model element to show it in the Properties - fixture.selectModelInModelExplorer(); - - // Back to the Properties view - editor.getView(PROPERTY_SHEET, false); - - memory.add(editor.getModel()); - memory.add(editor.getModel().getAppliedProfile("j2ee")); - } - - /** - * Verify that models with dynamic profiles applied (and the profiles and everything else) don't leak when when validation is run on them - * (the case of profiles that have OCL constraints and, therefore, do have {@link ETypedElement}s of {@link EGenericType} type). - */ - @Test - @SoftReferenceSensitive - @PluginResource("model/profile/model.di") - public void testValidatedProfiledModelContentDoesNotLeak() { - // Validate the model - try { - new ValidateModelCommand(editor.getModel()).execute(new NullProgressMonitor(), null); - } catch (ExecutionException e) { - e.printStackTrace(); - fail("Failed to validate model: " + e.getLocalizedMessage()); - } - - // The validation command activated the Model Validation view. Return to Properties - editor.getView(PROPERTY_SHEET, false); - - editor.flushDisplayEvents(); - - memory.add(editor.getModel()); - memory.add(editor.getModel().getAppliedProfile("j2ee")); - } - - /** - * Verify that the attachment of listeners to the UML's shared item providers doesn't - * cause any leaks (all is properly cleaned up when unloading the editor). - */ - @Test - @SoftReferenceSensitive - @PluginResource("model/basic/unnamed_diagram.di") - public void testCleanUpListenersOnItemProviders() { - memory.add(editor.getModelSet()); - - DiagramEditor diagramEditor = (DiagramEditor) editor.getEditor().getActiveEditor(); - memory.add(diagramEditor.getDiagramEditPart()); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorReloadTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorReloadTest.java deleted file mode 100644 index cd443491697..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorReloadTest.java +++ /dev/null @@ -1,719 +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.editor.integration.tests.tests; - -import static org.eclipse.papyrus.junit.matchers.DiagramMatchers.collapsedIn; -import static org.eclipse.papyrus.junit.matchers.DiagramMatchers.editPartSelected; -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.lang.reflect.Method; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Set; -import java.util.regex.Pattern; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.edit.command.CommandParameter; -import org.eclipse.emf.edit.command.SetCommand; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.palette.PaletteContainer; -import org.eclipse.gef.palette.PaletteDrawer; -import org.eclipse.gef.palette.PaletteEntry; -import org.eclipse.gef.palette.PaletteStack; -import org.eclipse.gef.palette.ToolEntry; -import org.eclipse.gef.ui.palette.PaletteViewer; -import org.eclipse.gef.ui.views.palette.PaletteView; -import org.eclipse.jface.viewers.AbstractTreeViewer; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer; -import org.eclipse.papyrus.infra.core.services.IService; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; -import org.eclipse.papyrus.infra.core.utils.AdapterUtils; -import org.eclipse.papyrus.infra.emf.utils.EMFHelper; -import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; -import org.eclipse.papyrus.junit.framework.classification.ExpensiveTest; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.eclipse.papyrus.junit.utils.Duck; -import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture; -import org.eclipse.papyrus.junit.utils.rules.PluginResource; -import org.eclipse.papyrus.junit.utils.rules.ShowView; -import org.eclipse.papyrus.junit.utils.rules.ShowView.Location; -import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView; -import org.eclipse.swt.widgets.Item; -import org.eclipse.swt.widgets.TreeItem; -import org.eclipse.swt.widgets.Widget; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.navigator.CommonViewer; -import org.eclipse.ui.part.IPage; -import org.eclipse.ui.part.PageBookView; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.OpaqueAction; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.VisibilityKind; -import org.eclipse.uml2.uml.resource.UMLResource; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; - -import com.google.common.base.Splitter; -import com.google.common.base.Supplier; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; - - -/** - * Test cases checking that various different scenarios in Papyrus editor re-loading for changes in resource dependencies. - * - * @see bug 437217 - */ -@ExpensiveTest -@PluginResource({ EditorReloadTest.EMPLOYMENT_MODEL, EditorReloadTest.BANKING_MODEL, EditorReloadTest.LIBRARY_MODEL }) -public class EditorReloadTest extends AbstractPapyrusTest { - - static final String PROPERTY_SHEET_VIEW_ID = "org.eclipse.ui.views.PropertySheet"; - - static final String EMPLOYMENT_MODEL = "model/reload/employment.di"; - - static final String BANKING_MODEL = "model/reload/banking.di"; - - static final String LIBRARY_MODEL = "model/reload/library.di"; - - @Rule - public final PapyrusEditorFixture editorFixture = new PapyrusEditorFixture(); - - private IMultiDiagramEditor employmentEditor; - - private IMultiDiagramEditor bankingEditor; - - private IMultiDiagramEditor libraryEditor; - - public EditorReloadTest() { - super(); - } - - /** - * Verify that dependent editors are not re-loaded immediately (this is deferred until they are activated). - */ - @Test - public void testReloadIsDeferred() { - final ReloadAssertion reload = new ReloadAssertion(employmentEditor, bankingEditor); - - pokeLibraryModel(); - editorFixture.save(libraryEditor); - - reload.assertNotReloaded(); - } - - /** - * Verify that re-loading two dependent editors doesn't mess up the perspective layout. - */ - @Test - public void testPerspectiveLayoutUnperturbed() { - final ReloadAssertion reload = new ReloadAssertion(employmentEditor, bankingEditor); - - pokeLibraryModel(); - reload.save(libraryEditor); - - // The ordering and separation of editor stacks is unchanged - assertThat(editorFixture.getPartStack(employmentEditor), is(Arrays. asList(employmentEditor, libraryEditor))); - assertThat(editorFixture.getPartStack(bankingEditor), is(Arrays. asList(bankingEditor))); - } - - /** - * Verify that, after a Save All action that saves a non-active editor causing the active editor to re-load in place, - * the originally active editor is active once again. - */ - @Test - public void testActiveEditorRestoredSaveAll() { - final ReloadAssertion reload = new ReloadAssertion(employmentEditor); - - pokeLibraryModel(); - editorFixture.activate(employmentEditor); - editorFixture.saveAll(); - - reload.assertReloaded(); // The editor is reloaded immediately because it is already active - - assertThat(employmentEditor.getSite().getPage().getActiveEditor(), is((IEditorPart)employmentEditor)); - } - - /** - * Verify that the nested editor that was active is active again after the re-load. - */ - @Test - public void testActiveDiagramRestored() { - final String diagramTitle = "ActivityDiagram"; - final ReloadAssertion reload = new ReloadAssertion(employmentEditor); - - editorFixture.activate(employmentEditor); - editorFixture.activateDiagram(employmentEditor, diagramTitle); - - pokeLibraryModel(); - reload.save(libraryEditor); - - editorFixture.activate(employmentEditor); - assertThat(employmentEditor.getActiveEditor(), notNullValue()); - assertThat(employmentEditor.getActiveEditor().getTitle(), is(diagramTitle)); - } - - /** - * Verify that edit-part selections in a diagram are restored after the re-load. - */ - @Test - public void testEditPartSelectionRestored() { - final String diagramTitle = "ActivityDiagram"; - final String nodeName = "do work"; - final ReloadAssertion reload = new ReloadAssertion(employmentEditor); - - EditPart activityNode = editorFixture.activateDiagram(employmentEditor, diagramTitle).findEditPart(nodeName, OpaqueAction.class); - editorFixture.select(activityNode); - - pokeLibraryModel(); - reload.save(libraryEditor); - - activityNode = editorFixture.activateDiagram(employmentEditor, diagramTitle).findEditPart(nodeName, OpaqueAction.class); - - assertThat(activityNode, notNullValue()); - assertThat(activityNode, editPartSelected()); - } - - /** - * Verify that drawer, stack, and tool state in the palette is restored after editor re-load. - */ - @Test - public void testPaletteStateRestored() { - doTestPaletteStateRestored(); - } - - /** - * Verify that drawer, stack, and tool state in the Palette View is restored after editor re-load. - */ - @ShowView(PaletteView.ID) - @Test - public void testPaletteStateRestored_paletteView() { - doTestPaletteStateRestored(); - } - - void doTestPaletteStateRestored() { - final String diagramTitle = "ActivityDiagram"; - final String drawerLabel = "Edges"; - final String stackLabel = "ControlNodes"; - final String stackEntryLabel = "Activity final"; - final String activeToolLabel = "Comment"; - final ReloadAssertion reload = new ReloadAssertion(employmentEditor); - - PaletteViewer palette = editorFixture.activateDiagram(employmentEditor, diagramTitle).getPalette(); - - // Collapse the Edges drawer - PaletteDrawer edges = find(palette.getPaletteRoot(), drawerLabel, PaletteDrawer.class); - new Duck(palette.getEditPartRegistry().get(edges)).quack("setExpanded", false); - - // Select the Activity Final Node in the control nodes stack - PaletteStack stack = find(palette.getPaletteRoot(), stackLabel, PaletteStack.class); - stack.setActiveEntry(find(stack, stackEntryLabel, ToolEntry.class)); - - // And make the Comment tool active - palette.setActiveTool(find(palette.getPaletteRoot(), activeToolLabel, ToolEntry.class)); - - editorFixture.flushDisplayEvents(); - - pokeLibraryModel(); - reload.save(libraryEditor); - - palette = editorFixture.activateDiagram(employmentEditor, diagramTitle).getPalette(); - - // Verify the Edges drawer - edges = find(palette.getPaletteRoot(), drawerLabel, PaletteDrawer.class); - assertThat(edges, collapsedIn(palette)); - - // Verify Activity Final Node selection in its stack - stack = find(palette.getPaletteRoot(), stackLabel, PaletteStack.class); - assertThat(stack.getActiveEntry().getLabel(), is(stackEntryLabel)); - - // Verify the active tool - assertThat(palette.getActiveTool().getLabel(), is(activeToolLabel)); - } - - @ShowView(value = ModelExplorerPageBookView.VIEW_ID, location = Location.LEFT) - @Test - public void testModelExplorerSelectionRestored() { - final ReloadAssertion reload = new ReloadAssertion(employmentEditor); - - editorFixture.activate(employmentEditor); - - Set selectedLabels = ImmutableSet.of("employment::Company", "types::Name::firstName"); - - reload.verifySelection(modelExplorerSupplier(), selectedLabels); - } - - @ShowView(value = ModelExplorerPageBookView.VIEW_ID, location = Location.LEFT) - @Test - public void testModelExplorerExpansionRestored() { - final ReloadAssertion reload = new ReloadAssertion(employmentEditor); - - editorFixture.activate(employmentEditor); - - Set expandedLabels = ImmutableSet.of("employment::A_company_person_1", "types::UML Primitive Types::PrimitiveTypes::Real"); - - reload.verifyExpansion(modelExplorerSupplier(), expandedLabels); - } - - @ShowView(value = ModelExplorerPageBookView.VIEW_ID, location = Location.LEFT) - @Test - public void testModelExplorerReferencedLibrariesRestored() { - final ReloadAssertion reload = new ReloadAssertion(employmentEditor); - - editorFixture.activate(employmentEditor); - - // Load something we haven't loaded before - editorFixture.getModelSet(employmentEditor).getResource(URI.createURI(UMLResource.JAVA_PRIMITIVE_TYPES_LIBRARY_URI), true); - editorFixture.flushDisplayEvents(); - - Set selectedLabels = ImmutableSet.of("Java Primitive Types::Long"); - - reload.verifySelection(modelExplorerSupplier(), selectedLabels); - } - - @ShowView(value = { ModelExplorerPageBookView.VIEW_ID, PROPERTY_SHEET_VIEW_ID }, location = { Location.LEFT, Location.BELOW }) - @Test - public void testPropertySheetRestoredShowingCorrectInput() { - final ReloadAssertion reload = new ReloadAssertion(employmentEditor); - - pokeLibraryModel(); - pokeEmploymentModel(); // And this one, too! - - EditPart companyClassEP = editorFixture.activateDiagram(employmentEditor, "classes").findEditPart("Company", org.eclipse.uml2.uml.Class.class); - assertThat(companyClassEP, notNullValue()); - editorFixture.select(companyClassEP); - editorFixture.flushDisplayEvents(); - - EObject propertySheetSelection = getPropertySheetSelection(); - assertThat(propertySheetSelection, is(EMFHelper.getEObject(companyClassEP))); - - editorFixture.activate(editorFixture.getView(ModelExplorerPageBookView.VIEW_ID, false)); - Set selectedLabels = ImmutableSet.of("employment::Person"); - reload.select(modelExplorerSupplier(), selectedLabels); - editorFixture.flushDisplayEvents(); - - editorFixture.saveAll(); - - reload.assertReloaded(); // The editor is reloaded immediately because it is already active - - editorFixture.flushDisplayEvents(); - - // The property sheet still has the Person class selected, not Company - propertySheetSelection = getPropertySheetSelection(); - assertThat(propertySheetSelection, instanceOf(org.eclipse.uml2.uml.Class.class)); - assertThat(((org.eclipse.uml2.uml.Class)propertySheetSelection).getName(), is("Person")); - } - - /** - * Verifies that where an editor is organized with multiple sash folders, the correct tab is active overall and the - * correct tab in each sash pane is visible (not just the last tab in each pane). - */ - @PluginResource({ "model/reload/employment_sashes.di", EditorReloadTest.LIBRARY_MODEL }) - @Test - public void testSashFoldersRestored() { - employmentEditor = editorFixture.getEditor("model/reload/employment_sashes.di"); - final ReloadAssertion reload = new ReloadAssertion(employmentEditor); - - ISashWindowsContainer sashContainer = AdapterUtils.adapt(employmentEditor, ISashWindowsContainer.class, null); - - // On opening, the table is visible because it's the last tab in its folder - Set visible = getVisiblePages(sashContainer); - assertThat(visible, is((Set)ImmutableSet.of("classes", "classes_table"))); - - // So, activate the activity diagram - editorFixture.activateDiagram(employmentEditor, "activity"); - - // Then activate the class diagram again so that being the active diagram isn't the reason why the activity - // diagram is restored to visible state - editorFixture.activateDiagram(employmentEditor, "classes"); - - pokeLibraryModel(); - editorFixture.activate(employmentEditor); - editorFixture.saveAll(); - reload.assertReloaded(); // The editor is reloaded immediately because it is already active - editorFixture.flushDisplayEvents(); - - sashContainer = AdapterUtils.adapt(employmentEditor, ISashWindowsContainer.class, null); - - // After re-load, the activity diagram is the visible one in its folder - visible = getVisiblePages(sashContainer); - assertThat(visible, is((Set)ImmutableSet.of("classes", "activity"))); - - // But the activity diagram isn't visible because it's the active page - assertThat(sashContainer.getActiveSashWindowsPage().getPageTitle(), is("classes")); - } - - // - // Test framework - // - - @Before - public void layOutWorkbenchPage() { - employmentEditor = editorFixture.getEditor(EMPLOYMENT_MODEL); - bankingEditor = editorFixture.getEditor(BANKING_MODEL); - libraryEditor = editorFixture.getEditor(LIBRARY_MODEL); - - // Non-standard test cases will not have one of these - if((employmentEditor != null) && (bankingEditor != null) && (libraryEditor != null)) { - // Move the banking editor into its own part of the editor area - editorFixture.splitEditorArea(bankingEditor, false); - } - } - - void pokeLibraryModel() { - // First, make sure that the library editor is active (user can't edit it, otherwise!) - editorFixture.activate(libraryEditor); - - Package library = editorFixture.getModel(libraryEditor); - Type ssn = library.getOwnedType("SSN"); - EditingDomain domain = editorFixture.getEditingDomain(libraryEditor); - domain.getCommandStack().execute(domain.createCommand(SetCommand.class, new CommandParameter(ssn, UMLPackage.Literals.NAMED_ELEMENT__NAME, "SocialSecurityNumber"))); - } - - void pokeEmploymentModel() { - // First, make sure that the library editor is active (user can't edit it, otherwise!) - editorFixture.activate(employmentEditor); - - Package employment = editorFixture.getModel(employmentEditor); - Type person = employment.getOwnedType("Person"); - EditingDomain domain = editorFixture.getEditingDomain(employmentEditor); - domain.getCommandStack().execute(domain.createCommand(SetCommand.class, new CommandParameter(person, UMLPackage.Literals.NAMED_ELEMENT__VISIBILITY, VisibilityKind.PUBLIC_LITERAL))); - } - -

P find(PaletteContainer container, String label, Class

type) { - P result = null; - - for(P next : Iterables.filter(container.getChildren(), type)) { - if(label.equalsIgnoreCase(next.getLabel())) { - result = next; - break; - } - } - - if(result == null) { - for(PaletteContainer next : Iterables.filter(container.getChildren(), PaletteContainer.class)) { - result = find(next, label, type); - if(result != null) { - break; - } - } - } - - return result; - } - - Set getLabels(Item... items) { - Set result = Sets.newHashSet(); - - for(Item next : items) { - result.add(getLabel(next)); - } - - return result; - } - - TreeItem[] getItems(AbstractTreeViewer tree, Collection labels) { - List result = Lists.newArrayListWithCapacity(labels.size()); - - for(String next : labels) { - Widget search = tree.getControl(); - for(String part : Splitter.on(NamedElement.SEPARATOR).split(next)) { - search = findItem(tree, search, part); - } - - if(search instanceof TreeItem) { - result.add((TreeItem)search); - } - } - - return Iterables.toArray(result, TreeItem.class); - } - - static final Pattern METACLASS_QUALIFIER = Pattern.compile("<.+>"); - - static final Pattern STEREOTYPE_QUALIFIER = Pattern.compile("«.+»"); - - static String getLabel(Item item) { - String result = item.getText(); - - if(result != null) { - result = METACLASS_QUALIFIER.matcher(result).replaceAll(""); - result = STEREOTYPE_QUALIFIER.matcher(result).replaceAll(""); - result = result.trim(); - } - - return result; - } - - private Item findItem(AbstractTreeViewer tree, Widget parent, String label) { - Item result = null; - - if(parent != null) { - if(parent instanceof TreeItem) { - tree.expandToLevel(parent.getData(), 1); - } - - for(Item next : (Item[])new Duck(parent).quack("getItems")) { - if(label.equals(getLabel(next))) { - result = next; - break; - } - } - } - - return result; - } - - Supplier modelExplorerSupplier() { - return new Supplier() { - - public CommonViewer get() { - return editorFixture.getModelExplorerView().getCommonViewer(); - } - }; - } - - EObject getPropertySheetSelection() { - IViewPart propertySheet = editorFixture.getView(PROPERTY_SHEET_VIEW_ID, true); - assertThat(propertySheet, instanceOf(PageBookView.class)); - IPage currentPage = ((PageBookView)propertySheet).getCurrentPage(); - assertThat(currentPage, instanceOf(TabbedPropertySheetPage.class)); - TabbedPropertySheetPage tabbed = (TabbedPropertySheetPage)currentPage; - - IStructuredSelection result = null; - - try { - Method getCurrentSelection = TabbedPropertySheetPage.class.getDeclaredMethod("getCurrentSelection"); - getCurrentSelection.setAccessible(true); - result = (IStructuredSelection)getCurrentSelection.invoke(tabbed); - assertThat("Nothing selected in property sheet", (result == null) || result.isEmpty(), is(false)); - } catch (Exception e) { - e.printStackTrace(); - fail("Failed to get property sheet selection: " + e.getLocalizedMessage()); - } - - return EMFHelper.getEObject(result.getFirstElement()); - } - - Set getVisiblePages(ISashWindowsContainer sashContainer) { - Set result = Sets.newHashSet(); - - for(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage page : sashContainer.getVisiblePages()) { - result.add(page.getPageTitle()); - } - - return result; - } - - private class ReloadAssertion { - - private final Set editors; - - private final Set unloaded = Sets.newHashSet(); - - ReloadAssertion(IMultiDiagramEditor... editor) { - this.editors = Sets.newHashSet(editor); - - for(IMultiDiagramEditor next : editors) { - ServicesRegistry services = next.getServicesRegistry(); - - try { - services.add(Canary.class, 1, new Canary(next)); - services.startServicesByClassKeys(Canary.class); - } catch (ServiceException e) { - e.printStackTrace(); - fail("Failed to start Canary service: " + e.getLocalizedMessage()); - } - } - } - - /** - * Saves the specified editor, kicks the registered dependent editors by activating them, and asserts that they were re-loaded. - */ - void save(IMultiDiagramEditor editor) { - editorFixture.save(editor); - kick(); - assertReloaded(); - } - - void kick() { - if(!editors.isEmpty()) { - IWorkbenchPage page = Iterables.getFirst(editors, null).getSite().getPage(); - IEditorPart active = page.getActiveEditor(); - - for(IEditorPart next : editors) { - // Activate this editor to trigger reload - page.activate(next); - } - - if(active != null) { - // Restore the active editor - page.activate(active); - } - - editorFixture.flushDisplayEvents(); - } - } - - void verifySelection(Supplier viewerSupplier, Set selectedLabels) { - assertThat("Must have exactly one dependent editor registered for test.", editors.size(), is(1)); - - final IMultiDiagramEditor dependent = Iterables.getOnlyElement(editors); - - Set selectedObjects = select(viewerSupplier, selectedLabels); - - editorFixture.activate(dependent); - - Set selectedAgain = getSelection(viewerSupplier); - - assertThat(selectedAgain, is(selectedObjects)); - } - - Set select(Supplier viewerSupplier, Set selectedLabels) { - org.eclipse.jface.viewers.TreeViewer viewer = viewerSupplier.get(); - - Set result = Sets.newHashSet(); - List selection = Lists.newArrayListWithCapacity(selectedLabels.size()); - for(TreeItem item : getItems(viewer, selectedLabels)) { - selection.add(item.getData()); - EObject object = EMFHelper.getEObject(item.getData()); - result.add(EcoreUtil.getURI(object)); - } - - viewer.setSelection(new StructuredSelection(selection)); - - return result; - } - - Set getSelection(Supplier viewerSupplier) { - org.eclipse.jface.viewers.TreeViewer viewer = viewerSupplier.get(); - Set result = Sets.newHashSet(); - for(Object next : ((IStructuredSelection)viewer.getSelection()).toList()) { - EObject object = EMFHelper.getEObject(next); - result.add(EcoreUtil.getURI(object)); - } - return result; - } - - void verifyExpansion(Supplier viewerSupplier, Set expandedLabels) { - assertThat("Must have exactly one dependent editor registered for test.", editors.size(), is(1)); - - final IMultiDiagramEditor dependent = Iterables.getOnlyElement(editors); - org.eclipse.jface.viewers.TreeViewer viewer = viewerSupplier.get(); - - for(TreeItem next : getItems(viewer, expandedLabels)) { - next.setExpanded(true); - } - Set expandedObjects = Sets.newHashSet(); - for(Object next : viewer.getExpandedElements()) { - EObject object = EMFHelper.getEObject(next); - expandedObjects.add(EcoreUtil.getURI(object)); - } - - pokeLibraryModel(); - save(libraryEditor); - - editorFixture.activate(dependent); - - viewer = viewerSupplier.get(); - Set expandedAgain = Sets.newHashSet(); - for(Object next : viewer.getExpandedElements()) { - EObject object = EMFHelper.getEObject(next); - expandedAgain.add(EcoreUtil.getURI(object)); - } - assertThat(expandedAgain, is(expandedObjects)); - - } - - void assertUnloaded() { - assertThat("Some editors were not unloaded", unloaded, is(editors)); - } - - void assertLoaded() { - for(IMultiDiagramEditor next : editors) { - try { - boolean loaded = next.getServicesRegistry().isStarted(ModelSet.class.getName()); - assertThat("Editor not loaded: " + next.getTitle(), loaded, is(true)); - } catch (ServiceException e) { - e.printStackTrace(); - fail("Editor not loaded: " + next.getTitle()); - } - } - } - - void assertReloaded() { - assertUnloaded(); - assertLoaded(); - } - - void assertNotUnloaded() { - assertThat("Some editors were unloaded", Sets.difference(editors, unloaded), is(editors)); - } - - void assertNotReloaded() { - assertNotUnloaded(); - assertLoaded(); - } - - private class Canary implements IService { - - private final IMultiDiagramEditor editor; - - private ServicesRegistry services; - - Canary(IMultiDiagramEditor editor) { - this.editor = editor; - } - - public void init(ServicesRegistry servicesRegistry) throws ServiceException { - services = servicesRegistry; - - // For symmetry only; this never actually has any effect - unloaded.remove(editor); - } - - public void disposeService() throws ServiceException { - unloaded.add(editor); - services = null; - } - - public void startService() throws ServiceException { - // Load everything in the resource set so that we are sure to know of the dependency on the library model - EcoreUtil.resolveAll(services.getService(ModelSet.class)); - } - } - - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/ModelSetTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/ModelSetTests.java deleted file mode 100644 index f4ffc871dd0..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/ModelSetTests.java +++ /dev/null @@ -1,128 +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.editor.integration.tests.tests; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.papyrus.commands.ICreationCommand; -import org.eclipse.papyrus.editor.integration.tests.Activator; -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.ExtensionServicesRegistry; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; -import org.eclipse.papyrus.infra.core.utils.DiResourceSet; -import org.eclipse.papyrus.infra.ui.extension.commands.IModelCreationCommand; -import org.eclipse.papyrus.junit.utils.EditorUtils; -import org.eclipse.papyrus.uml.diagram.clazz.CreateClassDiagramCommand; -import org.eclipse.papyrus.uml.diagram.clazz.UmlClassDiagramForMultiEditor; -import org.eclipse.papyrus.uml.diagram.common.commands.CreateUMLModelCommand; -import org.eclipse.papyrus.uml.tools.model.UmlModel; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.Model; -import org.junit.Assert; -import org.junit.Test; - -/** - * Test case for handling models with special characters in their name/path - * - * @author Camille Letavernier - * - */ -public class ModelSetTests extends AbstractEditorIntegrationTest { - - public static final String SOURCE_PATH = "/model/model set/"; - - @Test - public void testOpenModelWithSpecialChars() throws Exception { - initModel("openSpecialChars", "^&_&^", getBundle()); - IPageManager pageManager = getPageManager(); - //Fix test to match re-specification in Bug 429242: we only expect 2 pages (Instead of 3), because one of them is - //now invalid (Table v1 framework is deprecated and not available anymore) - Assert.assertEquals("Some pages cannot be found", 2, pageManager.allPages().size()); - - UmlModel umlModel = (UmlModel)getModelSet().getModel(UmlModel.MODEL_ID); - Model rootModel = (Model)umlModel.lookupRoot(); - Assert.assertEquals("The UML Model has not been correctly loaded", 3, rootModel.getOwnedElements().size()); - } - - @Test - public void testCreateModelWithSpecialChars() throws Exception { - ModelSet modelSet = new DiResourceSet(); - IProject emptyModelCreationProject = ResourcesPlugin.getWorkspace().getRoot().getProject("diagramCreationWithSpecialChars"); - emptyModelCreationProject.create(new NullProgressMonitor()); - emptyModelCreationProject.open(new NullProgressMonitor()); - - String modelName = "++n�w m�d�l & sp�c��l ch�r$++"; - - final IFile emptyModelDi = emptyModelCreationProject.getFile(modelName + ".di"); - - modelSet.createsModels(emptyModelDi); - - IFile emptyModelNotation = emptyModelCreationProject.getFile(modelName + ".notation"); - IFile emptyModelUml = emptyModelCreationProject.getFile(modelName + ".uml"); - - ServicesRegistry registry = new ExtensionServicesRegistry(org.eclipse.papyrus.infra.core.Activator.PLUGIN_ID); - try { - registry.add(ModelSet.class, Integer.MAX_VALUE, modelSet); - registry.startRegistry(); - } catch (ServiceException ex) { - //Ignore - } - - IModelCreationCommand creationCommand = new CreateUMLModelCommand(); - creationCommand.createModel(modelSet); - - //Create the root UML Model - UmlModel umlModel = (UmlModel)modelSet.getModel(UmlModel.MODEL_ID); - Model model = (Model)umlModel.lookupRoot(); - - //Creates and opens a Papyrus Class Diagram - ICreationCommand diagramCreationCommand = new CreateClassDiagramCommand(); - diagramCreationCommand.createDiagram(modelSet, model, modelName); - - modelSet.save(new NullProgressMonitor()); - - Assert.assertTrue("The DI file has not been created", emptyModelDi.exists()); - Assert.assertTrue("The Notation file has not been created", emptyModelNotation.exists()); - Assert.assertTrue("The UML file has not been created", emptyModelUml.exists()); - - Display.getDefault().syncExec(new Runnable() { - - public void run() { - try { - editor = EditorUtils.openPapyrusEditor(emptyModelDi); - } catch (Exception ex) { - Activator.log.error(ex); - Assert.fail(ex.getMessage()); - } - } - }); - - Assert.assertNotNull("Cannot open the Papyrus editor", editor); - Assert.assertTrue("The active editor should be a Papyrus Class Diagram editor", editor.getActiveEditor() instanceof UmlClassDiagramForMultiEditor); - - try { - registry.disposeRegistry(); - } catch (ServiceException ex) { - //Ignore - } - - } - - @Override - protected String getSourcePath() { - return SOURCE_PATH; - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/PageManagerTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/PageManagerTests.java deleted file mode 100644 index 4bbcfb5f3c1..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/PageManagerTests.java +++ /dev/null @@ -1,567 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013, 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) - bug 433371 - * Christian W. Damus - bug 485220 - * - *****************************************************************************/ -package org.eclipse.papyrus.editor.integration.tests.tests; - -import static org.hamcrest.CoreMatchers.hasItem; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.MatcherAssert.assertThat; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.command.CompoundCommand; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gmf.runtime.common.core.command.CompositeCommand; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.papyrus.commands.DestroyElementPapyrusCommand; -import org.eclipse.papyrus.commands.ICreationCommand; -import org.eclipse.papyrus.commands.OpenDiagramCommand; -import org.eclipse.papyrus.editor.integration.tests.Activator; -import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.infra.core.sasheditor.editor.IPage; -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.ExtensionServicesRegistry; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; -import org.eclipse.papyrus.infra.core.utils.DiResourceSet; -import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper; -import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils; -import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; -import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; -import org.eclipse.papyrus.infra.ui.extension.commands.IModelCreationCommand; -import org.eclipse.papyrus.junit.utils.EditorUtils; -import org.eclipse.papyrus.uml.diagram.clazz.CreateClassDiagramCommand; -import org.eclipse.papyrus.uml.diagram.clazz.UmlClassDiagramForMultiEditor; -import org.eclipse.papyrus.uml.diagram.common.commands.CreateUMLModelCommand; -import org.eclipse.papyrus.uml.diagram.sequence.UmlSequenceDiagramForMultiEditor; -import org.eclipse.papyrus.uml.diagram.timing.custom.UmlTimingDiagramForMultiEditor; -import org.eclipse.papyrus.uml.tools.model.UmlModel; -import org.eclipse.papyrus.uml.tools.model.UmlUtils; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.BehavioredClassifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - -/** - * Tests the basic PageManager cases, integrated with the CoreMultiDiagramEditor - * and a few UML Diagrams/Tables - * - * @author Camille Letavernier - * - */ -public class PageManagerTests extends AbstractEditorIntegrationTest { - - public static final String SOURCE_PATH = "/model/basic/"; - - @Test - public void testModelWithDiagramCreation() throws Exception { - ModelSet modelSet = new DiResourceSet(); - IProject emptyModelCreationProject = ResourcesPlugin.getWorkspace().getRoot().getProject("diagramModelCreation"); - emptyModelCreationProject.create(new NullProgressMonitor()); - emptyModelCreationProject.open(new NullProgressMonitor()); - - final IFile emptyModelDi = emptyModelCreationProject.getFile("diagram_model_creation.di"); - - modelSet.createsModels(emptyModelDi); - - IFile emptyModelNotation = emptyModelCreationProject.getFile("diagram_model_creation.notation"); - IFile emptyModelUml = emptyModelCreationProject.getFile("diagram_model_creation.uml"); - - ServicesRegistry registry = new ExtensionServicesRegistry(org.eclipse.papyrus.infra.core.Activator.PLUGIN_ID); - try { - registry.add(ModelSet.class, Integer.MAX_VALUE, modelSet); - registry.startRegistry(); - } catch (ServiceException ex) { - // Ignore - } - - IModelCreationCommand creationCommand = new CreateUMLModelCommand(); - creationCommand.createModel(modelSet); - - // Create the root UML Model - UmlModel umlModel = (UmlModel) modelSet.getModel(UmlModel.MODEL_ID); - Model model = (Model) umlModel.lookupRoot(); - - // Creates and opens a Papyrus Class Diagram - ICreationCommand diagramCreationCommand = new CreateClassDiagramCommand(); - diagramCreationCommand.createDiagram(modelSet, model, "TestDiagram1"); - - modelSet.save(new NullProgressMonitor()); - - Assert.assertTrue("The DI file has not been created", emptyModelDi.exists()); - Assert.assertTrue("The Notation file has not been created", emptyModelNotation.exists()); - Assert.assertTrue("The UML file has not been created", emptyModelUml.exists()); - - Display.getDefault().syncExec(new Runnable() { - - public void run() { - try { - editor = EditorUtils.openPapyrusEditor(emptyModelDi); - } catch (Exception ex) { - Activator.log.error(ex); - Assert.fail(ex.getMessage()); - } - } - }); - - Assert.assertNotNull("Cannot open the Papyrus editor", editor); - Assert.assertTrue("The active editor should be a Papyrus Class Diagram editor", editor.getActiveEditor() instanceof UmlClassDiagramForMultiEditor); - - try { - registry.disposeRegistry(); - } catch (ServiceException ex) { - // Ignore - } - } - - @Test - public void testEmptyModelCreation() throws Exception { - final IFile emptyModelDi = createEmptyModel(); - Assert.assertNotNull(emptyModelDi); - - Display.getDefault().syncExec(new Runnable() { - - public void run() { - try { - editor = EditorUtils.openPapyrusEditor(emptyModelDi); - } catch (Exception ex) { - Activator.log.error(ex); - Assert.fail(ex.getMessage()); - } - } - }); - - Assert.assertNotNull("Cannot open the editor", editor); - openAndCheckCreatedModel(emptyModelDi); - } - - private IFile createEmptyModel() throws Exception { - ModelSet modelSet = new DiResourceSet(); - IProject emptyModelCreationProject = ResourcesPlugin.getWorkspace().getRoot().getProject("emptyModelCreation"); - emptyModelCreationProject.create(new NullProgressMonitor()); - emptyModelCreationProject.open(new NullProgressMonitor()); - - final IFile emptyModelDi = emptyModelCreationProject.getFile("empty_model_creation.di"); - - modelSet.createsModels(emptyModelDi); - - IModelCreationCommand creationCommand = new CreateUMLModelCommand(); - creationCommand.createModel(modelSet); - - modelSet.save(new NullProgressMonitor()); - - IFile emptyModelNotation = emptyModelCreationProject.getFile("empty_model_creation.notation"); - IFile emptyModelUml = emptyModelCreationProject.getFile("empty_model_creation.uml"); - - Assert.assertTrue("The DI file has not been created", emptyModelDi.exists()); - Assert.assertTrue("The Notation file has not been created", emptyModelNotation.exists()); - Assert.assertTrue("The UML file has not been created", emptyModelUml.exists()); - return emptyModelDi; - } - - private void openAndCheckCreatedModel(IFile emptyModelDi) throws Exception { - IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); - Assert.assertNotNull("Cannot retrieve the PageManager", pageManager); - Assert.assertTrue(pageManager.allPages().isEmpty()); - - ModelSet modelSet = editor.getServicesRegistry().getService(ModelSet.class); - Assert.assertNotNull("Cannot retrieve the ModelSet", modelSet); - - UmlModel umlModel = (UmlModel) modelSet.getModel(UmlModel.MODEL_ID); - Assert.assertNotNull("Cannot retrieve the UML Model", umlModel); - - EObject rootEObject = umlModel.lookupRoot(); - Assert.assertTrue("The rootElement is not a model", rootEObject instanceof Model); - } - - @Test - public void testOpenEmptyModel() throws Exception { - initModel("openEmptyModel", "empty_model", getBundle()); - IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); - Assert.assertEquals(0, pageManager.allPages().size()); - } - - @Test - public void testAvailableAndActivePage() throws Exception { - initModel("availableAndActivePage", "two_diagrams_model", getBundle()); - IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); - Assert.assertEquals(2, pageManager.allPages().size()); - - Assert.assertTrue(editor.getActiveEditor() instanceof UmlClassDiagramForMultiEditor); // TODO: The PageManager doesn't provide the getActivePage() method - - Resource notationResource = NotationUtils.getNotationModel(editor.getServicesRegistry().getService(ModelSet.class)).getResource(); - - Diagram classDiagram = (Diagram) notationResource.getContents().get(0); - Diagram timingDiagram = (Diagram) notationResource.getContents().get(1); - - TransactionalEditingDomain editingDomain = editor.getServicesRegistry().getService(TransactionalEditingDomain.class); - editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(new OpenDiagramCommand(editingDomain, timingDiagram))); - Assert.assertTrue(editor.getActiveEditor() instanceof UmlTimingDiagramForMultiEditor); - - - // Check type requested by selectPage - ISashWindowsContainer container = editor.getServicesRegistry().getService(ISashWindowsContainer.class); - IPage selectedPage = container.getActiveSashWindowsPage(); - - // FIXME: Does not work yet. See Bug 401107: [IPageManager] selectPage does not work - // TODO: There should be a specific test for selectPage, with a basic and a complex model - pageManager.selectPage(classDiagram); - Assert.assertTrue("Couldn't change the page selection", editor.getActiveEditor() instanceof UmlClassDiagramForMultiEditor); - - pageManager.selectPage(timingDiagram); - Assert.assertTrue("Couldn't change the page selection", editor.getActiveEditor() instanceof UmlTimingDiagramForMultiEditor); - } - - /** - * @author vincent lorenzo - * @throws Exception - */ - @Test - @Ignore("new papyrus table are not yet in the main build") - public void testAvailableAndActivePageWithNatTable() throws Exception { - // initModel("availableAndActivePage2", "two_tables_model"); - // IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); - // Assert.assertEquals(2, pageManager.allPages().size()); - // IEditorPart tableEditor = editor.getActiveEditor(); - // Assert.assertTrue(tableEditor instanceof NatTableEditor); //TODO: The PageManager doesn't provide the getActivePage() method - // INattableModelManager manager = (INattableModelManager)tableEditor.getAdapter(INattableModelManager.class); - // Assert.assertNotNull(manager); - // Assert.assertEquals("PapyrusGenericTable", manager.getTable().getTableConfiguration().getType()); - // - // Resource notationResource = NotationUtils.getNotationModel(editor.getServicesRegistry().getService(ModelSet.class)).getResource(); - // - // Table genericTable = (Table)notationResource.getContents().get(0); - // Table tableOfViews = (Table)notationResource.getContents().get(1); - // - // TransactionalEditingDomain editingDomain = editor.getServicesRegistry().getService(TransactionalEditingDomain.class); - // editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(new OpenDiagramCommand(editingDomain, tableOfViews))); - // tableEditor = editor.getActiveEditor(); - // Assert.assertTrue(tableEditor instanceof NatTableEditor); - // manager = (INattableModelManager)tableEditor.getAdapter(INattableModelManager.class); - // Assert.assertNotNull(manager); - // Assert.assertEquals("PapyrusViewsTable", manager.getTable().getTableConfiguration().getType()); - // - // //FIXME: Does not work yet. See Bug 401107: [IPageManager] selectPage does not work - // //TODO: There should be a specific test for selectPage, with a basic and a complex model - // pageManager.selectPage(genericTable); - // tableEditor = editor.getActiveEditor(); - // Assert.assertTrue(tableEditor instanceof NatTableEditor); //TODO: The PageManager doesn't provide the getActivePage() method - // manager = (INattableModelManager)tableEditor.getAdapter(INattableModelManager.class); - // Assert.assertNotNull(manager); - // Assert.assertEquals("Couldn't change the page selection", "PapyrusGenericTable", manager.getTable().getTableConfiguration().getType()); - // - // - // pageManager.selectPage(tableOfViews); - // tableEditor = editor.getActiveEditor(); - // Assert.assertTrue(tableEditor instanceof NatTableEditor); //TODO: The PageManager doesn't provide the getActivePage() method - // manager = (INattableModelManager)tableEditor.getAdapter(INattableModelManager.class); - // Assert.assertNotNull(manager); - // Assert.assertEquals("Couldn't change the page selection", "PapyrusViewsTable", manager.getTable().getTableConfiguration().getType()); - } - - @Test - public void testDiagramCreation() throws Exception { - initModel("diagramCreation", "empty_model", getBundle()); - ICreationCommand diagramCreationCommand = new CreateClassDiagramCommand(); - ModelSet modelSet = editor.getServicesRegistry().getService(ModelSet.class); - - TransactionalEditingDomain editingDomain = modelSet.getTransactionalEditingDomain(); - - CompositeCommand createAndOpenDiagram = new CompositeCommand("Create diagram"); - ICommand creationCommand = diagramCreationCommand.getCreateDiagramCommand(modelSet, null, "DiagramCreationTestDiagram"); - createAndOpenDiagram.add(creationCommand); - createAndOpenDiagram.add(new OpenDiagramCommand(editingDomain, creationCommand)); - - testPageCreation(createAndOpenDiagram, UmlClassDiagramForMultiEditor.class); - } - - @Test - public void testDiagramDeletion() throws Exception { - initModel("diagramDeletion", "simple_class_model", getBundle()); - ModelSet modelSet = getModelSet(); - final Diagram diagram = (Diagram) NotationUtils.getNotationModel(modelSet).getResource().getContents().get(0); - testPageDeletion(diagram, UmlClassDiagramForMultiEditor.class); - } - - @Test - public void testDiagramIndirectDeletion_bug433371() throws Exception { - initModel("bug433371", "delete_sash_page", getBundle()); - ModelSet modelSet = getModelSet(); - final Diagram diagram = (Diagram) NotationUtils.getNotationModel(modelSet).getResource().getContents().get(1); - - IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); - pageManager.selectPage(diagram); // Make sure the one we want deleted is active - - testPageDeletion(diagram.getElement(), diagram, UmlSequenceDiagramForMultiEditor.class); - } - - /** - * @author vincent lorenzo - * @throws Exception - */ - @Test - @Ignore("new papyrus table are not yet in the main build") - public void testNatTableDeletion() throws Exception { - // initModel("tableDeletion", "simple_uml_generic_table_model"); - // ModelSet modelSet = getModelSet(); - // final Table diagram = (Table)NotationUtils.getNotationModel(modelSet).getResource().getContents().get(0); - // testPageDeletion(diagram, NatTableEditor.class); - } - - // Does not work. The table creation produces two executable commands (Create Table Editor and Identity) - // Only Identity (which does nothing) is undoable. Undoing the table creation does nothing - // This is an EMF Facet Table bug, which tries to delete columns for an empty table as soon as the table is created - @Test - public void testTableCreation() throws Exception { - initModel("tableCreation", "empty_model", getBundle()); - - final ServicesRegistry registry = editor.getServicesRegistry(); - ModelSet modelSet = registry.getService(ModelSet.class); - TransactionalEditingDomain editingDomain = modelSet.getTransactionalEditingDomain(); - - final EObject tableContext = UmlUtils.getUmlModel(modelSet).getResource().getContents().get(0); - - - } - - - private void testPageCreation(ICommand creationCommand, Class expectedEditorClass) throws Exception { - IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); - - // Check initial state - Assert.assertTrue(pageManager.allPages().isEmpty()); - Assert.assertNull(editor.getActiveEditor()); - - EditingDomain editingDomain = editor.getServicesRegistry().getService(EditingDomain.class); - - editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(creationCommand)); - - for (int i = 0; i < 3; i++) { // Undo/Redo 3 times - Assert.assertEquals("The page has not been correctly created", 1, pageManager.allPages().size()); - Assert.assertTrue("The editor has not been correctly opened", expectedEditorClass.isInstance(editor.getActiveEditor())); - - editingDomain.getCommandStack().undo(); - - Assert.assertNull("The editor should be closed", editor.getActiveEditor()); - Assert.assertTrue("The page has not been correctly deleted", pageManager.allPages().isEmpty()); - - editingDomain.getCommandStack().redo(); - } - } - - private void testPageDeletion(final EObject page, Class expectedEditorClass) throws Exception { - final IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); - - // Check initial state - Assert.assertFalse(pageManager.allPages().isEmpty()); - int initialPagesSize = pageManager.allPages().size(); - - Assert.assertTrue(expectedEditorClass.isInstance(editor.getActiveEditor())); - - TransactionalEditingDomain editingDomain = editor.getServicesRegistry().getService(TransactionalEditingDomain.class); - - CompoundCommand command = new CompoundCommand("Delete diagram"); - - Command sashRemoveComd = new RecordingCommand(editingDomain, "Remove page") { - - @Override - protected void doExecute() { - pageManager.closeAllOpenedPages(page); - } - - }; - - command.append(sashRemoveComd); - command.append(new GMFtoEMFCommandWrapper(new DestroyElementPapyrusCommand(new DestroyElementRequest(page, false)))); - - editingDomain.getCommandStack().execute(command); - - for (int i = 0; i < 3; i++) { // Undo/Redo 3 times - Assert.assertNull("The editor should be closed", editor.getActiveEditor()); - Assert.assertEquals("The page has not been correctly deleted", initialPagesSize - 1, pageManager.allPages().size()); - - editingDomain.getCommandStack().undo(); - - Assert.assertEquals("The has not been correctly created", initialPagesSize, pageManager.allPages().size()); - Assert.assertTrue("The editor has not been correctly opened", expectedEditorClass.isInstance(editor.getActiveEditor())); - - editingDomain.getCommandStack().redo(); - } - } - - private void testPageDeletion(final EObject elementToDelete, final Object dependentPage, Class expectedEditorClass) throws Exception { - final IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); - - // Check initial state - assertThat("Page not open", pageManager.allPages(), hasItem(dependentPage)); - - assertThat("Wrong kind of page", editor.getActiveEditor(), instanceOf(expectedEditorClass)); - - TransactionalEditingDomain editingDomain = editor.getServicesRegistry().getService(TransactionalEditingDomain.class); - - Element clazz = getRootUMLModel().getOwnedType("Class1"); - Behavior toDelete = ((BehavioredClassifier) clazz).getOwnedBehaviors().get(0); - IElementEditService edit = ElementEditServiceUtils.getCommandProvider(clazz); - ICommand command = edit.getEditCommand(new DestroyElementRequest(toDelete, false)); - - editingDomain.getCommandStack().execute(GMFtoEMFCommandWrapper.wrap(command)); - - for (int i = 0; i < 3; i++) { // Undo/Redo 3 times - assertThat("The editor page should be closed", pageManager.allPages(), not(hasItem(dependentPage))); - - editingDomain.getCommandStack().undo(); - - assertThat("The page has not been correctly restored", pageManager.allPages(), hasItem(dependentPage)); - - editingDomain.getCommandStack().redo(); - } - } - - @Test - public void testContainedDiagramDeletion() throws Exception { - initModel("deleteContainedDiagrams", "delete_contained_diagram", getBundle()); - ModelSet modelSet = getModelSet(); - IPageManager pageManager = getPageManager(); - TransactionalEditingDomain editingDomain = getTransactionalEditingDomain(); - - final int initialSize = pageManager.allPages().size(); - Model model = (Model) UmlUtils.getUmlModel(modelSet).getResource().getContents().get(0); - - IElementEditService provider; - - Element firstRootElement = model.getOwnedElements().get(0); - Element secondRootElement = model.getOwnedElements().get(1); - - { - DestroyElementRequest destroyFirstElementRequest = new DestroyElementRequest(firstRootElement, false); - provider = ElementEditServiceUtils.getCommandProvider(firstRootElement); - ICommand destroyFirstElementCommand = provider.getEditCommand(destroyFirstElementRequest); - - editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(destroyFirstElementCommand)); - Assert.assertEquals("The page should have been destroyed", initialSize - 1, pageManager.allPages().size()); - // TODO: Test the opened pages too - } - - { - DestroyElementRequest destroySecondElementRequest = new DestroyElementRequest(secondRootElement, false); - provider = ElementEditServiceUtils.getCommandProvider(secondRootElement); - ICommand destroySecondElementCommand = provider.getEditCommand(destroySecondElementRequest); - - editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(destroySecondElementCommand)); - Assert.assertTrue("All remaining pages should have been destroyed", pageManager.allPages().isEmpty()); - } - - editingDomain.getCommandStack().undo(); - - Assert.assertEquals("The deleted pages should have been restored", initialSize - 1, pageManager.allPages().size()); - - editingDomain.getCommandStack().undo(); - - Assert.assertEquals("All pages should have been restored", initialSize, pageManager.allPages().size()); - - editingDomain.getCommandStack().redo(); - editingDomain.getCommandStack().redo(); - - Assert.assertTrue("All remaining pages should have been destroyed", pageManager.allPages().isEmpty()); - } - - /** - * @author vincent lorenzo - * @throws Exception - */ - @Test - public void testContainedNatTableDeletion() throws Exception { - initModel("deleteContainedNatTable", "delete_contained_table", getBundle()); - ModelSet modelSet = getModelSet(); - IPageManager pageManager = getPageManager(); - TransactionalEditingDomain editingDomain = getTransactionalEditingDomain(); - - final int initialSize = pageManager.allPages().size(); - Model model = (Model) UmlUtils.getUmlModel(modelSet).lookupRoot(); - - IElementEditService provider; - - Element firstRootElement = model.getOwnedElements().get(0); - Element secondRootElement = model.getOwnedElements().get(1); - - { - DestroyElementRequest destroyFirstElementRequest = new DestroyElementRequest(firstRootElement, false); - provider = ElementEditServiceUtils.getCommandProvider(firstRootElement); - ICommand destroyFirstElementCommand = provider.getEditCommand(destroyFirstElementRequest); - - editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(destroyFirstElementCommand)); - Assert.assertEquals("The page should have been destroyed", initialSize - 1, pageManager.allPages().size()); - // TODO: Test the opened pages too - } - - { - DestroyElementRequest destroySecondElementRequest = new DestroyElementRequest(secondRootElement, false); - provider = ElementEditServiceUtils.getCommandProvider(secondRootElement); - ICommand destroySecondElementCommand = provider.getEditCommand(destroySecondElementRequest); - - editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(destroySecondElementCommand)); - Assert.assertTrue("All remaining pages should have been destroyed", pageManager.allPages().isEmpty()); - } - - editingDomain.getCommandStack().undo(); - - Assert.assertEquals("The deleted pages should have been restored", initialSize - 1, pageManager.allPages().size()); - - editingDomain.getCommandStack().undo(); - - Assert.assertEquals("All pages should have been restored", initialSize, pageManager.allPages().size()); - - editingDomain.getCommandStack().redo(); - editingDomain.getCommandStack().redo(); - - Assert.assertTrue("All remaining pages should have been destroyed", pageManager.allPages().isEmpty()); - } - - @Ignore("Unsupported yet") - @Test - public void testContainedTableDeletion() throws Exception { - throw new UnsupportedOperationException("Not implemented yet"); - } - - @Test - public void testMultipageEditor() throws Exception { - initModel("multipageEditor", "complex_multipage_model", getBundle()); - } - - @Test - public void testOpenModel() throws Exception { - initModel("openModel", "complex_multipage_model", getBundle()); - } - - @Override - protected String getSourcePath() { - return SOURCE_PATH; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/RecoveryTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/RecoveryTest.java deleted file mode 100644 index 18fb0ba9019..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/RecoveryTest.java +++ /dev/null @@ -1,175 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013, 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 485220 - * - *****************************************************************************/ -package org.eclipse.papyrus.editor.integration.tests.tests; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.command.CompoundCommand; -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.papyrus.commands.DestroyElementPapyrusCommand; -import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager; -import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper; -import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel; -import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils; -import org.eclipse.papyrus.uml.diagram.clazz.UmlClassDiagramForMultiEditor; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - -/** - * Tests the cases where the di model is not totally valid - * The Editor should be able to load the valid parts and should not - * fail on the invalid ones - * - * In most cases, we're simply interested in opening the Papyrus Editor - * (i.e. the model is invalid, so we don't expect to be able to manipulate - * the diagrams; but we should still be able to manipulate the editor - * and the semantic model, create new digrams, etc). - * - * @author Camille Letavernier - * - */ -public class RecoveryTest extends AbstractEditorIntegrationTest { - - private static final String SOURCE_PATH = "/model/recovery/"; - - // Should work - @Test - public void testInvalidAvailablePage() throws Exception { - initModel("invalidAvailablePage", "invalidAvailablePage", getBundle()); - Assert.assertTrue(editor.getActiveEditor() instanceof UmlClassDiagramForMultiEditor); - // IPageManager manager = editor.getServicesRegistry().getService(IPageManager.class); - // Is the page manager supposed to filter the invalid pages..? - // Assert.assertEquals(2, manager.allPages().size()); - } - - // Should work - // Bug 401109: [PageManager] Deleting an element which contains an opened page leads to critical model corruption - @Test - public void testInvalidTab() throws Exception { - initModel("invalidTab", "invalid_child_tab", getBundle()); - IPageManager manager = editor.getServicesRegistry().getService(IPageManager.class); - Assert.assertEquals(1, manager.allPages().size()); - } - - @Ignore("Recovery not supported") - // Not fixed yet - // Starts with an empty Di Model (All the contents have been erased, except the root xmi tag) - // We should be able to open a Papyrus editor and manipulate the PageManager - @Test - public void testEmptyDiModel() throws Exception { - initModel("emptyDiModel", "empty_di_model", getBundle()); - IPageManager manager = editor.getServicesRegistry().getService(IPageManager.class); - Assert.assertEquals(0, manager.allPages().size()); - NotationModel notationModel = (NotationModel) editor.getServicesRegistry().getService(ModelSet.class).getModel(NotationModel.MODEL_ID); - Assert.assertEquals(1, notationModel.getResource().getContents().size()); - Diagram diagram = (Diagram) notationModel.getResource().getContents().get(0); - manager.openPage(diagram); - Assert.assertEquals(1, manager.allPages().size()); - } - - // We should be able to open a page even if is not (yet) in the availablePages list - @Test - @Ignore("This test is not required anymore, as the allPages() is computed dynamically (Bug 429239)") - public void testUnavailablePageRecovery() throws Exception { - initModel("unavailablePageRecovery", "missing_page_recovery", getBundle()); - final IPageManager manager = editor.getServicesRegistry().getService(IPageManager.class); - int availablePages = manager.allPages().size(); - NotationModel notationModel = (NotationModel) editor.getServicesRegistry().getService(ModelSet.class).getModel(NotationModel.MODEL_ID); - Assert.assertEquals("Cannot find the diagram to open", 1, notationModel.getResource().getContents().size()); - - final Diagram diagram = (Diagram) notationModel.getResource().getContents().get(0); - - TransactionalEditingDomain domain = editor.getServicesRegistry().getService(TransactionalEditingDomain.class); - domain.getCommandStack().execute(new RecordingCommand(domain, "Open diagram") { - - @Override - protected void doExecute() { - manager.openPage(diagram); - } - }); - - Assert.assertEquals("A new page should be available", availablePages + 1, manager.allPages().size()); - } - - // Should work. The invalid tab is loaded as an "unresolved tab" and displays a warning. - @Test - public void testProxyDiagram() throws Exception { - initModel("proxyDiagram", "proxy_diagram_recovery", getBundle()); - IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); - Assert.assertEquals(2, pageManager.allPages().size()); - } - - @Ignore("Disabled because the Papyrus Editor opens a user dialog. Won't run on Hudson.") - // Should work - /** @see {link #testInvalidTab()} */ - @Test - public void testProxyTable() throws Exception { - initModel("proxyTable", "proxy_table_recovery", getBundle()); - // IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); - // Assert.assertEquals(2, pageManager.allPages()); - } - - // This model contains a few different errors (Unresolved proxy, invalid tabs, invalid available pages, ...) - @Test - public void testCompleteCase() throws Exception { - initModel("completeCase", "complex_invalid_model", getBundle()); - // IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); - // Assert.assertEquals(3, pageManager.allPages().size()); - } - - // We should be able to delete a diagram, even when there is an invalid page in the model - @Test - public void testDeleteDiagramWithInvalidAvailablePage() throws Exception { - initModel("deleteDiagramWithInvalidPage", "invalidAvailablePage", getBundle()); - - // Di layout: Diagram 0 - Invalid page - Diagram 1 - // We take the diagram at index 1 (i.e. after the invalid page) and try to delete it - final Diagram diagram = (Diagram) NotationUtils.getNotationModel(editor.getServicesRegistry().getService(ModelSet.class)).getResource().getContents().get(1); - - final IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); - - // Check initial state - int availablePages = pageManager.allPages().size(); - - TransactionalEditingDomain editingDomain = editor.getServicesRegistry().getService(TransactionalEditingDomain.class); - - CompoundCommand command = new CompoundCommand("Delete diagram"); - - Command sashRemoveComd = new RecordingCommand(editingDomain, "Remove page") { - - @Override - protected void doExecute() { - pageManager.closeAllOpenedPages(diagram); - } - - }; - - command.append(sashRemoveComd); - command.append(new GMFtoEMFCommandWrapper(new DestroyElementPapyrusCommand(new DestroyElementRequest(diagram, false)))); - - editingDomain.getCommandStack().execute(command); - - Assert.assertEquals("The page has not been correctly removed", availablePages - 1, pageManager.allPages().size()); - Assert.assertNull("The diagram should not be contained in the resource anymore", diagram.eResource()); - } - - @Override - protected String getSourcePath() { - return SOURCE_PATH; - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/.classpath b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/.classpath deleted file mode 100755 index eca7bdba8f0..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/.project b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/.project deleted file mode 100755 index d7e9bd1f78e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.infra.core.clipboard.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/core/org.eclipse.papyrus.infra.core.clipboard.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100755 index b3aa6d60f94..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.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/core/org.eclipse.papyrus.infra.core.clipboard.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100755 index 954281dbc31..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.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/core/org.eclipse.papyrus.infra.core.clipboard.tests/ClipboardTests.launch b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/ClipboardTests.launch deleted file mode 100755 index a2ba00d6405..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/ClipboardTests.launch +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/META-INF/MANIFEST.MF deleted file mode 100755 index fa829adba86..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui;bundle-version="3.107.0", - org.eclipse.core.runtime;bundle-version="3.11.0", - org.junit, - org.eclipse.papyrus.junit.framework;bundle-version="1.2.0", - org.eclipse.papyrus.junit.utils;bundle-version="2.0.100", - org.eclipse.papyrus.infra.core;bundle-version="[2.2.0,3.0.0)" -Export-Package: org.eclipse.papyrus.infra.core.clipboard.tests -Bundle-Vendor: %Bundle-Vendor -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.3.0.qualifier -Bundle-Name: %Bundle-Name -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.infra.core.clipboard.tests.Activator -Bundle-SymbolicName: org.eclipse.papyrus.infra.core.clipboard.tests;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/about.html b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/about.html deleted file mode 100755 index dd3c089a94c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/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/core/org.eclipse.papyrus.infra.core.clipboard.tests/build.properties b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/build.properties deleted file mode 100644 index f4bd95dd18e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/build.properties +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (c) 2015, 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: -# CEA List - Initial API and implementation -# Christian W. Damus - bug 502461 -# -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - plugin.xml -src.includes = about.html diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.properties b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.properties deleted file mode 100755 index 4a5eeecce71..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.properties +++ /dev/null @@ -1,3 +0,0 @@ -#Properties file for org.eclipse.papyrus.infra.core.clipboard.tests -Bundle-Vendor = Eclipse Modeling Project -Bundle-Name = Clipboard Tests \ No newline at end of file diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.xml b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.xml deleted file mode 100644 index 499607a6c58..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/pom.xml b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/pom.xml deleted file mode 100755 index e8fadb2e6c4..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.tests.releng - 1.2.0-SNAPSHOT - ../../../../../releng/main-tests - - org.eclipse.papyrus - org.eclipse.papyrus.infra.core.clipboard.tests - 1.3.0-SNAPSHOT - eclipse-test-plugin - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AWTClipboardUtils.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AWTClipboardUtils.java deleted file mode 100755 index 222bcfbb536..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AWTClipboardUtils.java +++ /dev/null @@ -1,45 +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.infra.core.clipboard.tests; - -import java.awt.Toolkit; -import java.awt.datatransfer.DataFlavor; -import java.awt.datatransfer.StringSelection; -import java.awt.datatransfer.UnsupportedFlavorException; -import java.io.IOException; - -public class AWTClipboardUtils { - - static void fillClipboard(String str) { - // its seems that the clipboard must be filled with the same way than we read it! - java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); - - // if (clipboard.isDataFlavorAvailable(DataFlavor.stringFlavor)) { - StringSelection s = new StringSelection(str); - clipboard.setContents(s, s); - // } - } - - static String getClipboardContents() throws UnsupportedFlavorException, IOException { - String bufferSystem = null; - - - java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); - - if (clipboard.isDataFlavorAvailable(DataFlavor.stringFlavor)) { - bufferSystem = clipboard.getData(DataFlavor.stringFlavor).toString(); - } - return bufferSystem; - - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/Activator.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/Activator.java deleted file mode 100755 index b47db9d61cd..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/Activator.java +++ /dev/null @@ -1,63 +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.infra.core.clipboard.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.infra.core.clipboard.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/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AllTests.java deleted file mode 100644 index 1a6091a0012..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015, 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: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 502461 - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.clipboard.tests; - -import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; -import org.junit.runner.RunWith; -import org.junit.runners.Suite.SuiteClasses; - -@RunWith(ClassificationSuite.class) -@SuiteClasses({ - ClipboardTests.class, - CopierFactoryTest.class, -}) -public class AllTests { - // JUnit 4 test suite - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/ClipboardTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/ClipboardTests.java deleted file mode 100755 index 06b1381bbdf..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/ClipboardTests.java +++ /dev/null @@ -1,86 +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: - * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.clipboard.tests; - -import java.awt.datatransfer.UnsupportedFlavorException; -import java.io.IOException; - -import org.eclipse.papyrus.junit.framework.classification.FailingTest; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.junit.Assert; -import org.junit.Test; - - -/** - * - * @author Vincent Lorenzo - * This tests classes tests provides clipboard reading and wrintg tests into the clipboard - */ -public class ClipboardTests extends AbstractPapyrusTest{ - - /** - * the string used to fill the clipboard. We don't use \n or \r\n, because it seems me than the implements AWT/SWT changes them and it is not the goal of these tests - */ - public static final String CLIPBOARD_CONTENTS = "Class1\tClass2_Class3\tClass4"; //$NON-NLS-1$ - - - @Test - public void fillSWT_readSWT() { - StringBuffer testedString = new StringBuffer(CLIPBOARD_CONTENTS); - testedString.append("test1"); //$NON-NLS-1$ - SWTClipboardUtils.fillClipboard(testedString.toString()); - String read = SWTClipboardUtils.getClipboardContents(); - Assert.assertNotNull(read); - Assert.assertEquals(testedString.toString(), read); - } - - /** - * 467554: filling clipboard with SWT and reading it with AWT doesn't work on Linux - * https://bugs.eclipse.org/bugs/show_bug.cgi?id=467554 - * - * @throws UnsupportedFlavorException - * @throws IOException - */ - @FailingTest - @Test - public void fillSWT_readAWT() throws UnsupportedFlavorException, IOException { - StringBuffer testedString = new StringBuffer(CLIPBOARD_CONTENTS); - testedString.append("test2"); //$NON-NLS-1$ - SWTClipboardUtils.fillClipboard(testedString.toString()); - String read = AWTClipboardUtils.getClipboardContents(); - Assert.assertNotNull(read); - Assert.assertEquals(testedString.toString(), read); - } - - @Test - public void fillAWT_readAWT() throws UnsupportedFlavorException, IOException { - StringBuffer testedString = new StringBuffer(CLIPBOARD_CONTENTS); - testedString.append("test3"); //$NON-NLS-1$ - AWTClipboardUtils.fillClipboard(testedString.toString()); - String read = AWTClipboardUtils.getClipboardContents(); - Assert.assertNotNull(read); - Assert.assertEquals(testedString.toString(), read); - } - - @Test - public void fillAWT_readSWT() { - StringBuffer testedString = new StringBuffer(CLIPBOARD_CONTENTS); - testedString.append("test4"); //$NON-NLS-1$ - AWTClipboardUtils.fillClipboard(testedString.toString()); - String read = SWTClipboardUtils.getClipboardContents(); - Assert.assertNotNull(read); - Assert.assertEquals(testedString.toString(), read); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/CopierFactoryTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/CopierFactoryTest.java deleted file mode 100644 index 08241e954ab..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/CopierFactoryTest.java +++ /dev/null @@ -1,185 +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.infra.core.clipboard.tests; - -import static org.eclipse.papyrus.junit.matchers.MoreMatchers.greaterThan; -import static org.eclipse.papyrus.junit.matchers.MoreMatchers.isEmpty; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.hamcrest.CoreMatchers.sameInstance; -import static org.hamcrest.MatcherAssert.assertThat; - -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EOperation; -import org.eclipse.emf.ecore.EReference; -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.clipboard.ICopierFactory; -import org.eclipse.papyrus.infra.core.clipboard.ICopierFactory.Configuration; -import org.eclipse.papyrus.infra.core.internal.clipboard.CopierFactory; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TestRule; -import org.junit.rules.TestWatcher; -import org.junit.runner.Description; - -/** - * Test cases for the {@link CopierFactory} class. - */ -@SuppressWarnings("restriction") -public class CopierFactoryTest { - - @Rule - public final TestRule configRule = TestConfigurator.rule(); - - /** - * Initializes me. - */ - public CopierFactoryTest() { - super(); - } - - /** - * Tests the factory with the default copy behaviour. - */ - @Test - public void defaultCopierFactory() { - EClass original = createTestModel(); - - EcoreUtil.Copier copier = ICopierFactory.getInstance(null).get(); - EClass copy = copy(original, copier); - - // Check that we have the copy we expect - assertThat(copy, not(sameInstance(original))); - assertThat(copy.getName(), is(original.getName())); - assertThat(copy.getEReferences().size(), is(2)); - - // And that the correct filtering was applied - copy.getEReferences().forEach(ref -> assertThat(ref.getEOpposite(), nullValue())); - - // Not this - assertThat(copy.getEReferences().stream().flatMap(ref -> ref.getEAnnotations().stream()) - .peek(a -> assertThat(a.getReferences(), not(isEmpty()))) - .count(), greaterThan(0L)); // In fact we have tested at least one - } - - /** - * Tests the factory with non-default copy behaviour to verify that - * configurators see the correct options in in the configuration. - */ - @Test - public void oneOffCopierFactory() { - EClass original = createTestModel(); - - EcoreUtil.Copier copier = ICopierFactory.getInstance(null, false).get(); - EClass copy = copy(original, copier); - - // Check that we have the copy we expect - assertThat(copy, not(sameInstance(original))); - assertThat(copy.getName(), is(original.getName())); - assertThat(copy.getEReferences().size(), is(2)); - - // And that the correct filtering was applied - assertThat(copy.getEReferences().stream().flatMap(ref -> ref.getEAnnotations().stream()) - .peek(a -> assertThat(a.getReferences(), isEmpty())) - .count(), greaterThan(0L)); // In fact we have tested at least one - - // Not this - copy.getEReferences().forEach(ref -> assertThat(ref.getEOpposite(), notNullValue())); - } - - // - // Test framework - // - - EClass createTestModel() { - EClass result = EcoreFactory.eINSTANCE.createEClass(); - result.setName("Test"); - - EReference r1 = EcoreFactory.eINSTANCE.createEReference(); - r1.setName("r1"); - result.getEStructuralFeatures().add(r1); - - EReference r2 = EcoreFactory.eINSTANCE.createEReference(); - r2.setName("r2"); - result.getEStructuralFeatures().add(r2); - - r2.setEOpposite(r1); - r1.setEOpposite(r2); - - EOperation o1 = EcoreFactory.eINSTANCE.createEOperation(); - o1.setName("o1"); - result.getEOperations().add(o1); - - EAnnotation annotation = EcoreFactory.eINSTANCE.createEAnnotation(); - annotation.setSource("test"); - r1.getEAnnotations().add(annotation); - annotation.getReferences().add(o1); - - return result; - } - - T copy(T original, EcoreUtil.Copier copier) { - @SuppressWarnings("unchecked") - T result = (T) copier.copy(original); - copier.copyReferences(); - return result; - } - - // - // Nested types - // - - public static final class TestConfigurator implements ICopierFactory.Configurator { - static boolean isEnabled; - - @Override - public void configureCopier(Configuration copierConfiguration) { - if (isEnabled) { - if (copierConfiguration.isUseOriginalReferences()) { - filter(copierConfiguration, EcorePackage.Literals.EREFERENCE__EOPPOSITE); - } else { - filter(copierConfiguration, EcorePackage.Literals.EANNOTATION__REFERENCES); - } - } - } - - void filter(Configuration copierConfig, EReference reference, EClass ownerType) { - copierConfig.filterReferences((ref, owner) -> (ref == reference) && ownerType.isInstance(owner)); - } - - void filter(Configuration copierConfig, EReference reference) { - filter(copierConfig, reference, reference.getEContainingClass()); - } - - static TestRule rule() { - return new TestWatcher() { - @Override - protected void starting(Description description) { - isEnabled = true; - } - - @Override - protected void finished(Description description) { - isEnabled = false; - } - }; - } - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/SWTClipboardUtils.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/SWTClipboardUtils.java deleted file mode 100755 index d07f10965b7..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/SWTClipboardUtils.java +++ /dev/null @@ -1,53 +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.infra.core.clipboard.tests; - -import org.eclipse.swt.dnd.Clipboard; -import org.eclipse.swt.dnd.TextTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.widgets.Display; - -public class SWTClipboardUtils { - - static void fillClipboard(String str) { - // adapted from CopyDataToClipboard from nattable - final TextTransfer textTransfer = TextTransfer.getInstance(); - final Clipboard clipboard = new Clipboard(Display.getDefault()); - try { - clipboard.setContents(new Object[] { str.toString() }, - new Transfer[] { textTransfer }); - } finally { - clipboard.dispose(); - } - - } - - static String getClipboardContents() { - // using SWT - final Display display = Display.getDefault(); - String contents = null; - final Clipboard clipboard = new Clipboard(display); - try { - - // we use the text transfert - final TextTransfer transfer = TextTransfer.getInstance(); - - contents = (String) clipboard.getContents(transfer); - - return contents; - } finally { - clipboard.dispose(); - } - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.classpath b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.classpath deleted file mode 100644 index 046bda900d2..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.project b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.project deleted file mode 100644 index 65b43a58362..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.infra.core.sasheditor.di.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/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 4759947300a..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.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.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 -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/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.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/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/META-INF/MANIFEST.MF deleted file mode 100644 index d1aa705cee3..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.junit;bundle-version="4.10.0", - org.eclipse.papyrus.junit.framework;bundle-version="1.2.0", - org.eclipse.emf.ecore.xmi;bundle-version="[2.12.0,3.0.0)", - org.eclipse.papyrus.infra.core.sasheditor.di;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.sasheditor.tests;bundle-version="1.2.0" -Export-Package: org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider, - org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal, - org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query, - org.eclipse.papyrus.infra.core.sasheditor.di.tests -Bundle-Vendor: %Bundle-Vendor -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %Bundle-Name -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.infra.core.sasheditor.di.tests;singleton:=true -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/OSGI-INF/l10n/bundle.properties b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/OSGI-INF/l10n/bundle.properties deleted file mode 100644 index a5066a7037e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/OSGI-INF/l10n/bundle.properties +++ /dev/null @@ -1,3 +0,0 @@ -#Properties file for org.eclipse.papyrus.infra.core.sasheditor.di.tests -Bundle-Vendor = Eclipse Modeling Project -Bundle-Name = Test fragment for org.eclipse.papyrus.infra.core.sasheditor.di plugin \ No newline at end of file diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/about.html b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.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/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/build.properties b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/build.properties deleted file mode 100644 index 2df796013bd..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -source.. = test/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - OSGI-INF/ diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/org.eclipse.papyrus.sasheditor.di.tests.launch b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/org.eclipse.papyrus.sasheditor.di.tests.launch deleted file mode 100644 index a0624255ff2..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/org.eclipse.papyrus.sasheditor.di.tests.launch +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/pom.xml b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/pom.xml deleted file mode 100644 index 067d87ee232..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.tests.releng - 1.2.0-SNAPSHOT - ../../../../../releng/main-tests - - org.eclipse.papyrus - org.eclipse.papyrus.infra.core.sasheditor.di.tests - 1.2.0-SNAPSHOT - eclipse-test-plugin - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/DiSashModelMngrTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/DiSashModelMngrTest.java deleted file mode 100644 index 56015a2d975..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/DiSashModelMngrTest.java +++ /dev/null @@ -1,201 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009, 2016 CEA LIST, LIFL, 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: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * Christian W. Damus - bug 485220 - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider; - -import static org.junit.Assert.assertNotNull; - -import java.io.File; - -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.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashWindowsMngr; -import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - - -/** - * @author cedric dumoulin - */ -public class DiSashModelMngrTest extends AbstractPapyrusTest { - - /** - * A fake factory for testing. - */ - protected IPageModelFactory fakeModelFactory; - - /** - * @see junit.framework.TestCase#setUp() - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - fakeModelFactory = new FakeModelFactory(); - } - - /** - * @see junit.framework.TestCase#tearDown() - * - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - // Nothing - } - - protected Resource createDiSashModelResource() { - // Create di resource - ResourceSet resourceSet = new ResourceSetImpl(); - - // Register the default resource factory -- only needed for stand-alone! - resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); - - // Get the URI of the model file. - URI fileURI = URI.createFileURI(new File("tempfile.di").getAbsolutePath()); - - Resource diResource = resourceSet.createResource(fileURI); - return diResource; - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelMngr#DiSashModelMngr(org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory)} - * . - */ - @Test - public void testDiSashModelMngrIPageModelFactory() { - - MyDISashModelMngr modelMngr = new MyDISashModelMngr(fakeModelFactory); - - assertNotNull("retrieve ContentProvider", modelMngr.getISashWindowsContentProvider()); - assertNotNull("retrieve PageMngr", modelMngr.getIPageMngr()); - assertNotNull("model created", modelMngr.getDiSashWindowsMngr()); - assertNotNull("default folder is set", modelMngr.getDiSashWindowsMngr().getSashModel().getCurrentSelection()); - // - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelMngr#DiSashModelMngr(org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory, org.eclipse.emf.ecore.resource.Resource)} - * . - */ - @Test - public void testDiSashModelMngrIPageModelFactoryResource() { - Resource resource = createDiSashModelResource(); - - MyDISashModelMngr modelMngr = new MyDISashModelMngr(fakeModelFactory, resource); - - assertNotNull("retrieve ContentProvider", modelMngr.getISashWindowsContentProvider()); - assertNotNull("retrieve PageMngr", modelMngr.getIPageMngr()); - assertNotNull("model created", modelMngr.getDiSashWindowsMngr()); - assertNotNull("default folder is set", modelMngr.getDiSashWindowsMngr().getSashModel().getCurrentSelection()); - assertNotNull("event provider is created", modelMngr.getSashModelContentChangedProvider()); - // Check resource - - assertNotNull("model attached to resource", lookupSashModel(resource)); - - } - - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelMngr#DiSashModelMngr(org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory, org.eclipse.papyrus.sashwindows.di.DiSashModel)} - * . - */ - @Test - public void testDiSashModelMngrIPageModelFactoryDiSashModel() { - SashWindowsMngr diSashModel = DiUtils.createDefaultSashWindowsMngr(); - - MyDISashModelMngr modelMngr = new MyDISashModelMngr(fakeModelFactory, diSashModel); - - assertNotNull("retrieve ContentProvider", modelMngr.getISashWindowsContentProvider()); - assertNotNull("retrieve PageMngr", modelMngr.getIPageMngr()); - assertNotNull("model created", modelMngr.getDiSashWindowsMngr()); - assertNotNull("default folder is set", modelMngr.getDiSashWindowsMngr().getSashModel().getCurrentSelection()); - assertNotNull("event provider is created", modelMngr.getSashModelContentChangedProvider()); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelMngr#getIPageMngr()}. - */ - @Test - public void testGetIPageMngr() { - MyDISashModelMngr modelMngr = new MyDISashModelMngr(fakeModelFactory); - - assertNotNull("retrieve PageMngr", modelMngr.getIPageMngr()); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelMngr#getISashWindowsContentProvider()}. - */ - @Test - public void testGetISashWindowsContentProvider() { - MyDISashModelMngr modelMngr = new MyDISashModelMngr(fakeModelFactory); - - assertNotNull("retrieve ContentProvider", modelMngr.getISashWindowsContentProvider()); - } - - /** - * Lookup for the SashModel object in the resource - * - * @param diResource - * @return - */ - private SashWindowsMngr lookupSashModel(Resource diResource) { - - return DiUtils.lookupSashWindowsMngr(diResource); - } - - // - // Nested types - // - - static class MyDISashModelMngr extends DiSashModelMngr { - - MyDISashModelMngr(IPageModelFactory pageModelFactory, boolean createDefaultSashModel) { - super(pageModelFactory, createDefaultSashModel); - } - - MyDISashModelMngr(IPageModelFactory pageModelFactory, Resource diResource) { - super(pageModelFactory, diResource); - } - - MyDISashModelMngr(IPageModelFactory pageModelFactory, SashWindowsMngr sashModel) { - super(pageModelFactory, sashModel); - } - - MyDISashModelMngr(IPageModelFactory pageModelFactory) { - super(pageModelFactory); - } - - // Overridden to make it accessible - @Override - protected SashWindowsMngr getDiSashWindowsMngr() { - return super.getDiSashWindowsMngr(); - } - - // Overridden to make it accessible - @Override - protected SashWindowsMngr lookupSashWindowMngr(Resource diResource) { - return super.lookupSashWindowMngr(diResource); - } - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/FakeModelFactory.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/FakeModelFactory.java deleted file mode 100644 index 5f18bc09626..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/FakeModelFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009 CEA LIST & LIFL - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; - - -/** - * @author dumoulin - */ -public class FakeModelFactory implements IPageModelFactory { - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory#createIPageModel(org.eclipse.emf.ecore.EObject) - * - * @param pageIdentifier - * @return - */ - public IPageModel createIPageModel(Object pageIdentifier) { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/AbstractDiContentProviderTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/AbstractDiContentProviderTest.java deleted file mode 100644 index 4f5cb8728f7..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/AbstractDiContentProviderTest.java +++ /dev/null @@ -1,394 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; - -import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.folder; -import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.hSash; -import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.page; -import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.vSash; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder; -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash; -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryExp; -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page; -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.QueryException; -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery; -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; -import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.eclipse.swt.SWT; -import org.junit.Test; - -/** - * Common ancestor for transactional and non transactional tests. - * - * @author cedric dumoulin - * - */ -public abstract class AbstractDiContentProviderTest extends AbstractPapyrusTest { - - /** - * The {@link DiContentProvider} under test. - */ - protected DiContentProvider diContentProvider; - - /** - * The {@link DiContentProvider} under test. - */ - protected ISashWindowsContentProvider contentProvider; - - /** - * ModelQuery used to query SashModel. - */ - protected SashModelQuery modelQuery; - - - /** - * Create the specified model in the SashModel. - * Concrete implementation should call {@link SashModelQuery}, and surround call - * with transaction if needed. - * - * - * @param query - */ - protected abstract void createModel(IQueryExp query) throws QueryException; - - /** - * Test if the model can be modofied. - * - * @throws QueryException - */ - @Test - public void testModelIsWritable() throws QueryException { - - // Try to create a model - IQueryExp query = folder("a", page(), page()); - createModel(query); - // Check creation - modelQuery.assertConform(query); - - // Other query - // Other query - query = new HSash(new Folder(new Page(), new Page("p1")), new Folder("a", new Page())); - createModel(query); - - // Check creation - modelQuery.assertConform(query); - Map result = modelQuery.queryModel(query); - assertNotNull("folder found", result.get("a")); - assertTrue("right type", result.get("a") instanceof TabFolder); - assertNotNull("page found", result.get("p1")); - assertTrue("right type", result.get("p1") instanceof PageRef); - - // ********************* - // Other query - query = hSash(folder(page(), page()), vSash("s2", folder(page()), folder(page()))); - createModel(query); - - // Check creation - modelQuery.assertConform(query); - result = modelQuery.queryModel(query); - - } - - /** - * Test tab close from a folder with more than one tab - * - * @throws QueryException - */ - @Test - public void testClosePage() throws QueryException { - - // Create a folder with several page - IQueryExp query = folder("f1", page("p1"), page("p2"), page("p3")); - createModel(query); - // Check creation - modelQuery.assertConform(query); - - // get models (from diModels, and factory for sashModel) - Map modelElements = modelQuery.queryModel(query); - SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); - - // do action : Close a page - contentProvider.removePage(sashModels.getFolder("f1"), 1); - - // check result - IQueryExp expectedModel = folder("f1", page("p1"), page("p3")); - modelQuery.assertConform(expectedModel); - - } - - /** - * Test tab close from a folder with only one tab. Some other folder - * exist - * - * @throws QueryException - */ - @Test - public void testCloseLastTab() throws QueryException { - // Create a folder with several page - IQueryExp query = hSash(folder("f1", page("p1"), page("p2"), page("p3")), folder("f2", page("p4"))); - createModel(query); - // Check creation - modelQuery.assertConform(query); - - // get models (from diModels, and factory for sashModel) - Map modelElements = modelQuery.queryModel(query); - SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); - - // do action : Close a page - contentProvider.removePage(sashModels.getFolder("f2"), 0); - - // check result - IQueryExp expectedModel = folder("f1", page("p1"), page("p2"), page("p3")); - modelQuery.assertConform(expectedModel); - - - } - - /** - * Test tab close from the last folder with only one tab. No more folder - * exists. - * - * @throws QueryException - * - */ - @Test - public void testCloseLastTabFromLastFolder() throws QueryException { - - // Create a folder with several page - IQueryExp query = folder("f1", page("p1")); - createModel(query); - // Check creation - modelQuery.assertConform(query); - - // get models (from diModels, and factory for sashModel) - Map modelElements = modelQuery.queryModel(query); - SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); - - // do action : Close a page - contentProvider.removePage(sashModels.getFolder("f1"), 0); - - // check result - IQueryExp expectedModel = folder("f1"); - modelQuery.assertConform(expectedModel); - } - - /** - * Test moving a page inside the same folder - * - * @throws QueryException - */ - @Test - public void testMovePageInsideFolder() throws QueryException { - - // Create a folder with several page - IQueryExp query = folder("f1", page("p1"), page("p2"), page("p3")); - createModel(query); - // Check creation - modelQuery.assertConform(query); - - // get models (from diModels, and factory for sashModel) - Map modelElements = modelQuery.queryModel(query); - SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); - - // do action : move a page - contentProvider.movePage(sashModels.getFolder("f1"), 1, 0); - - // check result - IQueryExp expectedModel = folder("f1", page("p2"), page("p1"), page("p3")); - modelQuery.assertConform(expectedModel); - - // do action : move a page - contentProvider.movePage(sashModels.getFolder("f1"), 0, 2); - - // check result - expectedModel = folder("f1", page("p1"), page("p3"), page("p2")); - modelQuery.assertConform(expectedModel); - - // do action : move a page - contentProvider.movePage(sashModels.getFolder("f1"), 2, 0); - - // check result - expectedModel = folder("f1", page("p2"), page("p1"), page("p3")); - modelQuery.assertConform(expectedModel); - } - - /** - * Test moving a page from folder to folder - * - * @throws QueryException - */ - @Test - public void testMovePageBetweenFolder() throws QueryException { - - // Create a folder with several page - IQueryExp query = hSash(folder("f1", page("p1"), page("p2"), page("p3")), folder("f2", page("p4"))); - createModel(query); - // Check creation - modelQuery.assertConform(query); - - // get models (from diModels, and factory for sashModel) - Map modelElements = modelQuery.queryModel(query); - SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); - - // do action : move a page - contentProvider.movePage(sashModels.getFolder("f1"), 1, sashModels.getFolder("f2"), 0); - - // check result - IQueryExp expectedModel = hSash(folder("f1", page("p1"), page("p3")), folder("f2", page("p2"), page("p4"))); - modelQuery.assertConform(expectedModel); - - // do action : move a page - contentProvider.movePage(sashModels.getFolder("f1"), 1, sashModels.getFolder("f2"), 1); - - // check result - expectedModel = hSash(folder("f1", page("p1")), folder("f2", page("p2"), page("p3"), page("p4"))); - modelQuery.assertConform(expectedModel); - - // do action : move a page, drop in target page (targetIndex == -1 - contentProvider.movePage(sashModels.getFolder("f2"), 0, sashModels.getFolder("f1"), -1); - - // check result - expectedModel = hSash(folder("f1", page("p1"), page("p2")), folder("f2", page("p3"), page("p4"))); - modelQuery.assertConform(expectedModel); - - } - - /** - * Test tab close from a folder with more than one tab - * - * @throws QueryException - */ - @Test - public void testCreateFolder() throws QueryException { - - // Create a folder with several page - IQueryExp query = folder("f1", page("p1"), page("p2"), page("p3")); - createModel(query); - // Check creation - modelQuery.assertConform(query); - - // get models (from diModels, and factory for sashModel) - Map modelElements = modelQuery.queryModel(query); - SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); - - // do action : create a folder - contentProvider.createFolder(sashModels.getFolder("f1"), 1, sashModels.getFolder("f1"), SWT.RIGHT); - - // check result - IQueryExp expectedModel = hSash(folder("f1", page("p1"), page("p3")), folder(page("p2"))); - modelQuery.assertConform(expectedModel); - - // do action : create a folder - contentProvider.createFolder(sashModels.getFolder("f1"), 0, sashModels.getFolder("f1"), SWT.UP); - - // check result - expectedModel = hSash(vSash(folder(page("p1")), folder("f1", page("p3"))), folder(page("p2"))); - modelQuery.assertConform(expectedModel); - - } - - /** - * Test moving a folder around another folder - * - * @throws QueryException - */ - @Test - public void testMoveFolderAroundFolder() throws QueryException { - - // Create a folder with several page - IQueryExp query = hSash(folder("f1", page("p1"), page("p2"), page("p3")), folder("f2", page("p4"), page("p5"))); - createModel(query); - // Check creation - modelQuery.assertConform(query); - - // get models (from diModels, and factory for sashModel) - Map modelElements = modelQuery.queryModel(query); - SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); - - // do action : move a folder - // -1 mean all pages - contentProvider.createFolder(sashModels.getFolder("f2"), -1, sashModels.getFolder("f1"), SWT.UP); - - // check result - IQueryExp expectedModel = vSash(folder(page("p4"), page("p5")), folder("f1", page("p1"), page("p2"), page("p3"))); - modelQuery.assertConform(expectedModel); - - } - - /** - * Test moving a folder inside another folder - * - * @throws QueryException - */ - @Test - public void testMoveFolderInsideFolder() throws QueryException { - - // Create a folder with several page - IQueryExp query = hSash(folder("f1", page("p1"), page("p2"), page("p3")), folder("f2", page("p4"), page("p5"))); - createModel(query); - // Check creation - modelQuery.assertConform(query); - - // get models (from diModels, and factory for sashModel) - Map modelElements = modelQuery.queryModel(query); - SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); - - // do action : move a folder. In fact, move all the pages - // -1 mean all pages - contentProvider.movePage(sashModels.getFolder("f2"), -1, sashModels.getFolder("f1"), -1); - - // check result - IQueryExp expectedModel = folder("f1", page("p1"), page("p2"), page("p3"), page("p4"), page("p5")); - modelQuery.assertConform(expectedModel); - - } - - /** - * Test moving a folder inside another folder - * - * @throws QueryException - */ - @Test - public void testMoveFolderInsideFolderAtSpecifiedIndex() throws QueryException { - - // Create a folder with several page - IQueryExp query = hSash(folder("f1", page("p1"), page("p2"), page("p3")), folder("f2", page("p4"), page("p5"))); - createModel(query); - // Check creation - modelQuery.assertConform(query); - - // get models (from diModels, and factory for sashModel) - Map modelElements = modelQuery.queryModel(query); - SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); - - // do action : move a folder. In fact, move all the pages - // -1 mean all pages - contentProvider.movePage(sashModels.getFolder("f2"), -1, sashModels.getFolder("f1"), 0); - - // check result - IQueryExp expectedModel = folder("f1", page("p4"), page("p5"), page("p1"), page("p2"), page("p3")); - modelQuery.assertConform(expectedModel); - - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CheckVisitor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CheckVisitor.java deleted file mode 100644 index d0e8a6b105a..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CheckVisitor.java +++ /dev/null @@ -1,119 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; - -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NoMatchException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; -import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; -import org.eclipse.papyrus.infra.core.sashwindows.di.Window; -import org.eclipse.swt.SWT; - - -/** - * @author cedric dumoulin - * - */ -public class CheckVisitor extends DiContentProviderBaseVisitor implements IPagesModelVisitor { - - /** - * @return the isVisitingParentFirst - */ - @Override - public boolean isVisitingParentFirst() { - return false; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) - * - * @param windowTerm - * @param windowModel - */ - @Override - public void visit(WindowTerm windowTerm, Window windowModel) { - // TODO Auto-generated method stub - - } - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder) - * - * @param folder - */ - @Override - public void visit(Folder folder, TabFolder folderModel) { - // Check name - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash) - * - * @param sash - * @throws NoMatchException - */ - @Override - public void visit(HSash sash, SashPanel sashModel) throws NoMatchException { - // Check orientation - if( sashModel.getDirection() != SWT.HORIZONTAL) { - throw new NoMatchException( this.toString() + " - SashOrientation does not match 'HORIZONTAL'" ); - } - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash) - * - * @param sash - * @throws NoMatchException - */ - @Override - public void visit(VSash sash , SashPanel sashModel) throws NoMatchException { - // Check orientation - if( sashModel.getDirection() != SWT.VERTICAL) { - throw new NoMatchException( this.toString() + " - SashOrientation does not match 'VERTICAL'" ); - } - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page) - * - * @param page - * @throws NoMatchException - */ - @Override - public void visit(Page page, PageRef pageModel) throws PagesModelException { - //check name - if(page.getIdentifier() != null) { - checkName(page.getIdentifier(), pageModel.getPageIdentifier()) ; - } - else if(page.getName() != null) { - checkName(page.getName(), pageModel.getPageIdentifier()) ; - } - } - - - protected void checkName( Object expectedName, Object foundName) throws NoMatchException { - if( expectedName != foundName ) - throw new NoMatchException( "Names do not match (expected=" - + expectedName + ", found="+ foundName ); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/ContentChangeListener.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/ContentChangeListener.java deleted file mode 100644 index 856058412db..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/ContentChangeListener.java +++ /dev/null @@ -1,43 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009 CEA LIST & LIFL - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IContentChangedListener; - -/** - * Listener on ContentChange for Tests. - * - * @author dumoulin - */ -public class ContentChangeListener implements IContentChangedListener { - - /** Count number of change event */ - private int changeCount = 0; - - /** - * @return the changeCount - */ - public int getChangeCount() { - return changeCount; - } - - public void contentChanged(ContentEvent event) { - changeCount++; - } - - public void reset() { - changeCount = 0; - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CreateModelVisitor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CreateModelVisitor.java deleted file mode 100644 index c50242dd7a6..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CreateModelVisitor.java +++ /dev/null @@ -1,147 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; - -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.AbstractSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PanelTerm; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; -import org.eclipse.papyrus.infra.core.sashwindows.di.DiFactory; -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; -import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; -import org.eclipse.papyrus.infra.core.sashwindows.di.Window; -import org.eclipse.swt.SWT; - -/** - * This visitor is used with {@link IQueryTerm} to create a {@link SashModel} instancied - * with the Sash, folders and pages specified in the query. - * - * - * @author cedric dumoulin - * - */ -public class CreateModelVisitor extends DiContentProviderBaseVisitor implements IPagesModelVisitor { - - /** - * @return the isVisitingParentFirst - */ - public boolean isVisitingParentFirst() { - return true; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) - * - * @param windowTerm - * @param windowModel - */ - public void visit(WindowTerm windowTerm, Window windowModel) { - // Create children of the sash - PanelTerm panel = windowTerm.getPanel(); - if(panel instanceof AbstractSash) { - windowModel.setPanel(DiFactory.eINSTANCE.createSashPanel()); - } - else if (panel instanceof Folder) { - windowModel.setPanel(DiFactory.eINSTANCE.createTabFolder()); - } - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder, org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder) - * - * @param folder - * @param folderModel - */ - public void visit(Folder folder, TabFolder folderModel) { - - // Create children of the folder - for( Page page : folder.getPages() ) { - folderModel.getChildren().add(DiFactory.eINSTANCE.createPageRef()); - } - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) - * - * @param sashQuery - * @param sashModel - */ - public void visit(HSash sashQuery, SashPanel sashModel) { - - // sash orientation - sashModel.setDirection(SWT.HORIZONTAL); - // Create children of the sash - - createPanelOrFolder(sashQuery.getLeftup(), sashModel); - createPanelOrFolder(sashQuery.getRightdown(), sashModel); - } - - /** - * @param sashModel - * @param panel - */ - private void createPanelOrFolder(PanelTerm panel, SashPanel parent ) { - if(panel instanceof AbstractSash) { - parent.getChildren().add(DiFactory.eINSTANCE.createSashPanel()); - } - else if (panel instanceof Folder) { - parent.getChildren().add(DiFactory.eINSTANCE.createTabFolder()); - } - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) - * - * @param sash - * @param sashModel - */ - public void visit(VSash sashQuery, SashPanel sashModel) { - // sash orientation - sashModel.setDirection(SWT.VERTICAL); - // Create children of the sash - createPanelOrFolder(sashQuery.getLeftup(), sashModel); - createPanelOrFolder(sashQuery.getRightdown(), sashModel); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page, org.eclipse.papyrus.infra.core.sashwindows.di.PageRef) - * - * @param page - * @param pageModel - */ - public void visit(Page page, PageRef pageModel) { - - - if(page.getIdentifier() != null) { - pageModel.setPageIdentifier(page.getIdentifier()); - } - else if(page.getName() != null) { - pageModel.setPageIdentifier(page.getName()); - } - else { - pageModel.setPageIdentifier(new Object()); - } - - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProvider2Test.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProvider2Test.java deleted file mode 100644 index 8e6020259fb..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProvider2Test.java +++ /dev/null @@ -1,67 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; - -import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory; -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryExp; -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.QueryException; -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; -import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils; -import org.junit.After; -import org.junit.Before; - -/** - * @author dumoulin - * - */ -public class DiContentProvider2Test extends AbstractDiContentProviderTest { - - /* - * - */ - @Before - public void setUp() throws Exception { - IPageModelFactory pageModelFactory = new FakePageModelFactory(); - SashModel diSashModel = DiUtils.createDefaultSashModel(); - diContentProvider = new DiContentProvider(diSashModel, pageModelFactory); - contentProvider = diContentProvider; - - // Create model query - modelQuery = new SashModelQuery(diSashModel); - } - - /** - * - * @see junit.framework.TestCase#tearDown() - * - * @throws Exception - */ - @After - public void tearDown() throws Exception { - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.AbstractDiContentProviderTest#createModel(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm) - * - * @param query - * @throws QueryException - */ - @Override - protected void createModel(IQueryExp query) throws QueryException { - modelQuery.createModel(query); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderBaseVisitor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderBaseVisitor.java deleted file mode 100644 index a7486266eb7..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderBaseVisitor.java +++ /dev/null @@ -1,326 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; - -import java.util.Iterator; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NoMatchException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModel; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; -import org.eclipse.papyrus.infra.core.sashwindows.di.AbstractPanel; -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; -import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; -import org.eclipse.papyrus.infra.core.sashwindows.di.Window; - -/** - * A base implementation of {@link IPagesModelVisitor} to visit conjointly SashPagesModel and - * {@link DiContentProvider}. - * - * This implementation separate the navigation part (walk(term, contentProviderModel)) and - * the visit part (visit(term, contentProviderModel)). It implements the navigation part. - *
- * The visit part should be implemented by subclasses. - * - * - * - * @author cedric dumoulin - * - */ -public class DiContentProviderBaseVisitor implements IPagesModelVisitor { - - /** - * @return the isVisitingParentFirst - */ - public boolean isVisitingParentFirst() { - return true; - } - - /** - * Visit the model. - * The second argument should be a SashModel, or one of its container (ex: DiContentProvider). - * - * @param pagesModel - * @param diPagesModel - * @throws PagesModelException - */ - public void walk(SashPagesModel pagesModel, Object diPagesModel) throws PagesModelException { - // Check associated model type - // It can be of different type: DiContentProvider or SashModel - // - SashModel sashModel = null; - if( diPagesModel instanceof SashModel) { - sashModel = (SashModel)diPagesModel; - } - else if(diPagesModel instanceof DiContentProvider) { - sashModel = ((DiContentProvider)diPagesModel).getDiSashModel(); - } - else { - throw new NoMatchException( "ContentProvider type ("+ diPagesModel.getClass().getName()+ ") does not match to SashModel or one of its container" ); - } - - - if( isVisitingParentFirst() ) { - visit(pagesModel, sashModel); - } - // visit children - for( WindowTerm windowTerm : pagesModel.getWindows() ) { - // Only one window - Window windowModel = sashModel.getWindows().get(0); - windowTerm.getPanel().accept(this, windowModel); - } - if( ! isVisitingParentFirst() ) { - visit(pagesModel, sashModel); - } - } - - /** - * Walk the WindowTerm and its child. - * @param windowTerm - * @param windowModel - * @throws PagesModelException - */ - public void walk(WindowTerm windowTerm, Object windowModel) throws PagesModelException { - // Check associated model type - if(! (windowModel instanceof Window) ) { - throw new NoMatchException( "ContentProvider type ("+ windowModel.getClass().getName()+ ") does not match to Window" ); - } - - Window window = (Window)windowModel; - - if( isVisitingParentFirst() ) { - visit(windowTerm, window); - } - // visit children - for( AbstractPanel panel : window.getChildren()) - windowTerm.getPanel().accept(this, panel); - - if( ! isVisitingParentFirst() ) { - visit(windowTerm, window); - } - } - - /** - * Walk folder and its children. - * - * @param folder - * @param folderModel - * @throws PagesModelException - */ - public void walk(Folder folder, Object model) throws PagesModelException { - // Check associated model type - if(! (model instanceof TabFolder) ) { - throw new NoMatchException( this.toString() - + "\n" + folder - + "\n - Model object type does not match to FolderQueryPart." - + " Expected TabFolder, found '" + model.getClass().getSimpleName() + "'." - + " (" + folder.getName() +")" ); - } - TabFolder folderModel = (TabFolder)model; - - // Visit this - if( isVisitingParentFirst() ) { - visit(folder, folderModel); - } - - // visit children - Iterator pageRefs = folderModel.getChildren().iterator(); - Iterator pageQueries = folder.getPages().iterator(); - while (pageRefs.hasNext() && pageQueries.hasNext() ) { - PageRef pageRef = pageRefs.next(); - Page query = pageQueries.next(); - - query.accept(this, pageRef); - } - if (pageRefs.hasNext()) { - // some page left - throw new NoMatchException( "Folder matching - " - + this.toString() - +" folder model have more pages than folder query. ("+folder.getName()+")" ); - } else if (pageQueries.hasNext() ) { - // some queries left - throw new NoMatchException( "Folder matching - " - + this.toString() - +" folder query have more page than folder model. ("+folder.getName()+")" ); - } - // Visit this - if( ! isVisitingParentFirst() ) { - visit(folder, folderModel); - } - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor#walk(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash, java.lang.Object) - * - * @param sash - * @param sashModel - * @throws PagesModelException - */ - public void walk(HSash sash, Object model) throws PagesModelException { - // Check associated model type - if(! (model instanceof SashPanel) ) { - throw new NoMatchException( this.toString() + " - Model object type does not match to SashPanel (found " - + model.getClass() - + " )"); - } - - SashPanel sashModel = (SashPanel)model; - -// // Check orientation -// if( sashModel.getDirection() != SWT.HORIZONTAL) { -// throw new NoMatchException( this.toString() + " - SashOrientation does not match 'HORIZONTAL'" ); -// } - // Visit this - if( isVisitingParentFirst() ) { - visit(sash, sashModel); - } - - // Visit children - sash.getLeftup().accept(this, sashModel.getChildren().get(0)); - sash.getRightdown().accept(this, sashModel.getChildren().get(1)); - - if( !isVisitingParentFirst() ) { - visit(sash, sashModel); - } - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor#walk(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash, java.lang.Object) - * - * @param sash - * @param sashModel - * @throws PagesModelException - */ - public void walk(VSash sash, Object model) throws PagesModelException { - // Check associated model type - if(! (model instanceof SashPanel) ) { - throw new NoMatchException( this.toString() + " - Model object type does not match to SashPanel (found " - + model.getClass() - + " )"); - } - - SashPanel sashModel = (SashPanel)model; - -// // Check orientation -// if( sashModel.getDirection() != SWT.VERTICAL) { -// throw new NoMatchException( this.toString() + " - SashOrientation does not match 'VERTICAL'" ); -// } - // Visit this - if( isVisitingParentFirst() ) { - visit(sash, sashModel); - } - - // Visit children - sash.getLeftup().accept(this, sashModel.getChildren().get(0)); - sash.getRightdown().accept(this, sashModel.getChildren().get(1)); - - if( !isVisitingParentFirst() ) { - visit(sash, sashModel); - } - } - - /** - * Walk the page. Simply call the corresponding {@link DiContentProviderBaseVisitor#visit(Page, IPageModel)} method. - * @param page - * @param pageModel - * @throws PagesModelException - */ - public void walk(Page page, Object model) throws PagesModelException { - // Check associated model type - if(! (model instanceof PageRef) ) { - throw new NoMatchException( this.toString() + " - Model object type does not match to PageRef" ); - } - PageRef pageModel = (PageRef)model; - visit(page, pageModel); - } - - - /** - * Visit the model. Actually, there is no counterpart for {@link SashPagesModel} in {@link SimpleContentProvider}. - * - * @param windowTerm - * @param windowModel - * @throws PagesModelException - */ - public void visit(SashPagesModel pagesModel, SashModel windowModel) throws PagesModelException { - - } - - /** - * Visit the corresponding node. - * To be implemented by subclass. - * - * - * @param windowTerm - * @param windowModel - */ - public void visit(WindowTerm windowTerm, Window windowModel) throws PagesModelException { - // To be implemented by subclass. - } - - /** - * Visit the corresponding node. - * To be implemented by subclass. - * - * @param folder - * @param folderModel - */ - public void visit(Folder folder, TabFolder folderModel) throws PagesModelException{ - - } - - /** - * Visit the corresponding node. - * To be implemented by subclass. - * - * @param sashQuery - * @param sashModel - */ - public void visit(HSash sashQuery, SashPanel sashModel) throws PagesModelException { - - } - - /** - * Visit the corresponding node. - * To be implemented by subclass. - * - * - * @param sash - * @param sashModel - */ - public void visit(VSash sashQuery, SashPanel sashModel) throws PagesModelException{ - } - - /** - * Visit the corresponding node. - * To be implemented by subclass. - * - * - * @param page - * @param pageModel - */ - public void visit(Page page, PageRef pageModel) throws PagesModelException { - - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacade.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacade.java deleted file mode 100644 index 42111da6ef4..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacade.java +++ /dev/null @@ -1,441 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IAbstractPanelModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory; -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.QueryException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.BadNameException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NotFoundException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PanelTerm; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; -import org.eclipse.papyrus.infra.core.sashwindows.di.AbstractPanel; -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; -import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; -import org.eclipse.papyrus.infra.core.sashwindows.di.Window; -import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils; - -/** - * Class providing a facade to test the {@link SimpleSashWindowsContentProvider} class. - *
- * This facade own a {@link DiContentProvider} and provides methods to manipulate it with - * the help of names. Each element in the {@link DiContentProvider} can be identified - * by a name (String). Then, the facade provide methods similar to {@link ISashWindowsContentProvider}, but using - * names rather than {@link IAbstractPanelModel} and {@link ITabFolderModel}. - *
- * The facade maintains a mapping between the names and the {@link ISashWindowsContentProvider} models. - * - * @author cedric dumoulin - * - */ -public class DiContentProviderFacade implements ISashWindowsContentProviderFacade { - - /** - * The internal content provider this facade is for. - */ - protected DiContentProvider contentProvider; - - /** - * Mapping between names provided in the expressions and internal implementations of the {@link SashModel}. - * This mapping is maintained when elements are added or removed. - * - */ - protected Map namesMapping; - /** - * Cache used to maintain wrappers used to wrap internal SashModel object - * to {@link ISashWindowsContentProvider} model. - */ - protected Map contentProviderWrapperCache = new HashMap(); - - /** - * Constructor. - * Create a default internal {@link SimpleSashWindowsContentProvider}; - * @param modelMngr - */ - public DiContentProviderFacade() { - IPageModelFactory pageModelFactory = new FakePageModelFactory(); - SashModel diSashModel = DiUtils.createDefaultSashModel(); - this.contentProvider = new DiContentProvider(diSashModel, pageModelFactory); - } - - /** - * Constructor. - * - * @param modelMngr - */ - public DiContentProviderFacade(DiContentProvider contentProvider) { - this.contentProvider = contentProvider; - } - - /** - * @return the contentProvider - */ - public ISashWindowsContentProvider getIContentProvider() { - return contentProvider; - } - - - /** - * Reset the namesMapping context accordingly to the provided expr. - * A side effect is that the internal structure is checked against the expr. - *
- * Reseting the names context allows to remove or add names to the context. - * It is used to add names of newly created elements (created with addPage() or createFolder() ) - - * @param expr - * @throws PagesModelException - */ - public void resetNamesContext(IModelExp expr) throws PagesModelException { - namesMapping = queryModel(expr); - } - - /** - * Check if the internal {@link ISashWindowsContentProvider} is conformed to the specified expression. - * @param expr - * @throws QueryException - */ - public void assertConform(IModelExp expr) throws PagesModelException { - - Object first; - if( expr instanceof WindowTerm) { - first = getFirstWindowModel(); - } - else if( expr instanceof PanelTerm) { - first = getFirstPanelModel(); - } - else { - throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + expr.toString() + ")"); - } - - CheckVisitor visitor = new CheckVisitor(); - expr.accept(visitor, first); - } - - /** - * Create an internal model conform to the specified expression. - * Any previous model is disguarded. - * - * This method should only be called once on a {@link SimpleSashWindowsContentProvider}. - *
- * If an expr term have a name, this name is kept in the facade and can be used later in methods like move, delete, ... - * - * @param expr Expression denoting the configuration to create. Must be one of (Folder, HSash, VSash) - * @throws QueryException - * - * TODO Ensure that the method can only be called once. For example, - * let this class extends {@link SimpleSashWindowsContentProvider}, and the constructor - * call this method. - */ - public void createModel(IModelExp expr) throws PagesModelException { - - Window first ; - if( expr instanceof PanelTerm) { - first = getFirstWindowModel(); - } - else { - throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + expr.toString() + ")"); - } - - // Create a surrounding WindowTerm - WindowTerm windowTerm = new WindowTerm((PanelTerm)expr); - - CreateModelVisitor visitor = new CreateModelVisitor(); - windowTerm.accept(visitor, first); - - // Fill mapping - namesMapping = queryModel(expr); - } - - /** - * Get element in the model. - * Each model element whose corresponding model query part as a name is added to the result map. - * The element is then accessible with the name set in the query part. - * - * @param query - * @return - * @throws QueryException - */ - public Map queryModel(IModelExp query) throws PagesModelException { - - Object first; - if( query instanceof WindowTerm) { - first = getFirstWindowModel(); - } - else if( query instanceof PanelTerm) { - first = getFirstPanelModel(); - } - else { - throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); - } - - QueryVisitor visitor = new QueryVisitor(); - query.accept(visitor, first); - - return visitor.getResult(); - } - - /** - * Get the model of the first the first window (in actual implementation their is only one window). - * @return - */ - private Window getFirstWindowModel() { - // Silly method to get the RootModel - return contentProvider.getDiSashModel().getWindows().get(0); - } - - /** - * Get the panel of the first window (in actual implementation their is only one window). - * @return - */ - private AbstractPanel getFirstPanelModel() { - // - return contentProvider.getDiSashModel().getWindows().get(0).getPanel(); - } - - /** - * Add a page to the model - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade#addPage(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page, java.lang.String, int) - * - * @param page - * @param folderName - * @param index - * @throws PagesModelException - */ - public void /*IPageModel*/ addPage(Page page, String folderName, int index) throws PagesModelException { - // Get the folder - TabFolderModel folderModel = getITabFolderModel( folderName ); - - Object pageRawModel = createPageRawModel(page); - - contentProvider.addPage(folderModel, index, pageRawModel); - - // Create the IContentProvider model, and return it. -// IPageModel pageModel = folderModel.createChildSashModel(???); -// return pageModel; - } - - /** - * Add a page to the model - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade#addPage(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page, java.lang.String, int) - * - * @param page - * @param folderName - * @throws PagesModelException - */ - public void /*IPageModel*/ addPage(Page page, String folderName) throws PagesModelException { - // Get the folder - TabFolderModel folderModel = getITabFolderModel( folderName ); - - - Object pageRawModel = createPageRawModel(page); - - contentProvider.addPage(folderModel, pageRawModel); - - // Create the IContentProvider model, and return it. - // createChildSashModel() require a PageRef -// IPageModel pageModel = folderModel.createChildSashModel(???); -// return pageModel; - } - - /** - * Get the pageModel used as identifier of a page. - * In the {@link DiContentProvider} implementation, the pageModel - * is an Object. - * In this implementation, we simply return the identifier of the name found in the - * declared page. If none is set, return a new Object. - * - * @param page - * @return an identifier for te page - */ - static public Object createPageRawModel( Page page ) { - - if(page.getIdentifier() != null) { - return page.getIdentifier(); - } - else if(page.getName() != null) { - return page.getName(); - } - else { - return new Object(); - } - - } - - /** - * - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade#movePage(java.lang.String, int, int) - * - * @param folderName - * @param oldIndex - * @param newIndex - * @throws NotFoundException - */ - public void movePage(String folderName, int oldIndex, int newIndex) throws NotFoundException { - // Get the folder - ITabFolderModel folderModel = getITabFolderModel( folderName ); - - contentProvider.movePage(folderModel, oldIndex, newIndex); - } - - public void movePage(String srcFolderName, int sourceIndex, String targetFolderName, int targetIndex) throws NotFoundException { - // Get the folders - ITabFolderModel srcFolderModel = getITabFolderModel( srcFolderName ); - ITabFolderModel targetFolderModel = getITabFolderModel( targetFolderName ); - - contentProvider.movePage(srcFolderModel, sourceIndex, targetFolderModel, targetIndex); - } - - public void removePage(String pageName) throws NotFoundException { - IPageModel pageModel = getIPageModel(pageName); - - contentProvider.removePage(pageModel); - - } - - public void removePage(String folderName, int tabIndex) throws NotFoundException { - // Get the folder - ITabFolderModel folderModel = getITabFolderModel( folderName ); - - contentProvider.removePage(folderModel, tabIndex); - // TODO remove page name from context - } - - public void createFolder(String tabFolderName, int tabIndex, String targetFolderName, int side) throws PagesModelException { - // Get the folders - ITabFolderModel srcFolderModel = getITabFolderModel( tabFolderName ); - TabFolderModel targetFolderModel = getITabFolderModel( targetFolderName ); - - contentProvider.createFolder(srcFolderModel, tabIndex, targetFolderModel, side); - - } - - /** - * Add an element in namesMapping. Throw an exception if the name already exist or if the name is not correct. - * - * @param name - * @param element - * @throws BadNameException - */ - protected void putNameMapping( String name, Object element) throws BadNameException { - - if( name == null || name.length() == 0 ) { - throw new BadNameException("Name '" + name + "' is not valid."); - } - - if(namesMapping.containsKey(name)) { - throw new BadNameException("Name '" + name + "' already exist in the context. Can't add it (but element is created)."); - } - - } - /** - * Get the {@link ITabFolderModel} associated to the name. - * In this implementation, each internal model is wrapped with its {@link ISashWindowsContentProvider} counterpart. - * For a folder, the wrapper is a {@link TabFolderModel}. - * The wrapper are cached in an associated cache. - * @param folderName - * @return - * @throws NotFoundException - */ - public TabFolderModel getITabFolderModel(String folderName) throws NotFoundException { - - // Check if the wrapper is already in the cache - Object cachedModel = contentProviderWrapperCache.get(folderName); - if(cachedModel != null) { - // Check the type - if( ! (cachedModel instanceof TabFolderModel) ) - throw new NotFoundException("An element named '" + folderName + "' is found but it is not of the expected type (ITabFolderModel). " ); - - // Found - return (TabFolderModel)cachedModel; - } - // Not found, create it - // Create a new wrapper - // First, get the corresponding internal representation - Object rawModel = namesMapping.get(folderName); - if( rawModel == null ) - throw new NotFoundException("Folder named '" + folderName + "' not found in the context of the expression."); - if( ! (rawModel instanceof TabFolder) ) - throw new NotFoundException("An element named '" + folderName + "' is found but it is not of the expected type (TabFolder). " ); - - // Create a wrapper and put it in the cache - TabFolderModel tabFolderModel = (TabFolderModel)contentProvider.createChildSashModel(rawModel); - contentProviderWrapperCache.put(folderName, tabFolderModel); - - // result - return tabFolderModel; - - } - - /** - * Get the {@link IPageModel} associated to the name. - * In this implementation, this is the internal element. - * @param pageName - * @return - * @throws NotFoundException - */ - public IPageModel getIPageModel(String pageName) throws NotFoundException { - - // Check if the wrapper is already in the cache - Object cachedModel = contentProviderWrapperCache.get(pageName); - if(cachedModel != null) { - // Check the type - if( ! (cachedModel instanceof IPageModel) ) - throw new NotFoundException("An element named '" + pageName + "' is found but it is not of the expected type (IPageModel). " ); - - // Found - return (IPageModel)cachedModel; - } - // Not found, create it - // Create a new wrapper - // First, get the corresponding internal representation - Object rawModel = namesMapping.get(pageName); - if( rawModel == null ) - throw new NotFoundException("Page named '" + pageName + "' not found in the context of the expression."); - if( ! (rawModel instanceof PageRef) ) - throw new NotFoundException("An element named '" + pageName + "' is found but it is not of the expected type (PageRef). " ); - - // Create a wrapper and put it in the cache - IPageModel pageModel = (IPageModel)contentProvider.createChildSashModel(rawModel); - contentProviderWrapperCache.put(pageName, pageModel); - - // result - return pageModel; - - } - - /** - * Return the associated maps of (names, internal representation). - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade#getNamesToInternalMap() - * - * @return - */ - public Map getNamesToInternalMap() { - return namesMapping; - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacadeTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacadeTest.java deleted file mode 100644 index 66d662675a5..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacadeTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.AbstractSashWindowContentProviderFacadeTest; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade; - - -/** - * @author dumoulin - * - */ -public class DiContentProviderFacadeTest extends AbstractSashWindowContentProviderFacadeTest { - - /** - * Constructor. - * - */ - public DiContentProviderFacadeTest() { - super(); - } - - /** - * Return the concrete implementation under test. - * @return - */ - @Override - public ISashWindowsContentProviderFacade createISashWindowsContentProviderFacade() { - return new DiContentProviderFacade(); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderTest.java deleted file mode 100644 index 7e78fec38b9..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderTest.java +++ /dev/null @@ -1,321 +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: - * CEA LIST - Initial API and implementation - * Christian W. Damus - bug 485220 - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IAbstractPanelModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IContentChangedListener; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IContentChangedListener.ContentEvent; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashPanelModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; -import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory; -import org.eclipse.papyrus.infra.core.sashwindows.di.AbstractPanel; -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; -import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; -import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils; -import org.eclipse.papyrus.junit.framework.classification.NotImplemented; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.eclipse.swt.SWT; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - - -/** - * - * @author cedric dumoulin - */ -public class DiContentProviderTest extends AbstractPapyrusTest { - - /** - * The {@link DiContentProvider} under test. - */ - protected MyDIContentProvider contentProvider; - - /** The FolderModel of the first TabFolder */ - protected ITabFolderModel folderModel; - - @Before - public void setUp() throws Exception { - IPageModelFactory pageModelFactory = new FakePageModelFactory(); - SashModel diSashModel = DiUtils.createDefaultSashModel(); - contentProvider = new MyDIContentProvider(diSashModel, pageModelFactory); - folderModel = lookupFolderModel(); - } - - /** - * - * @see junit.framework.TestCase#tearDown() - * - * @throws Exception - */ - @After - public void tearDown() throws Exception { - - } - - /** - * Lookup for a folder in the SashModel. Return the first folder found. - * - * @return - */ - private ITabFolderModel lookupFolderModel() { - if (contentProvider == null) { - return null; - } - - Object rawModel = contentProvider.getRootModel(); - IAbstractPanelModel panelModel = contentProvider.createChildSashModel(rawModel); - - return lookupFolderModel(panelModel); - } - - /** - * Recursively search in sash models for a FolderModel. - * Return the first encountered folder. - * - * @param panelModel - * @return - */ - private ITabFolderModel lookupFolderModel(IAbstractPanelModel panelModel) { - - if (panelModel instanceof ITabFolderModel) { - return (ITabFolderModel) panelModel; - } else { - ISashPanelModel sashModel = (ISashPanelModel) panelModel; - // Iterate on children - for (Object child : sashModel.getChildren()) { - IAbstractPanelModel childModel = contentProvider.createChildSashModel(child); - ITabFolderModel res = lookupFolderModel(childModel); - if (res != null) { - return res; - } - } - } - // Not found - return null; - } - - - /** - * Test a typical life cycle on contentProvider: - * creation, add change listener, add pages, move page - */ - @Test - public void testLifeCycle() { - - // A listener on change event. - ContentChangeListener changeListener = new ContentChangeListener(); - - // Set change listener - contentProvider.getContentChangedEventProvider().addListener(changeListener); - - // Add identifiers - // Use Object as identifiers. - List identifiers = new ArrayList(); - // Add 10 folders - for (int i = 0; i < 10; i++) { - // reset change count - changeListener.reset(); - // Add Editor - Object id = new Object(); - identifiers.add(id); - contentProvider.addPage(id); - - // Check fired events - Assert.assertEquals("One event fired", 1, changeListener.getChangeCount()); - } - - // Test moving a page - changeListener.reset(); - contentProvider.movePage(folderModel, 3, 8); - // Check fired events - Assert.assertEquals("One event fired", 1, changeListener.getChangeCount()); - - } - - - - /** - * Test type of the root model. - * Actually, it should be subtype of AbstractPanel {@link DiContentProvider#getRootModel()} - */ - @Test - public void testGetRootModel() { - - Assert.assertTrue("subtype of AbstractPanel", AbstractPanel.class.isInstance(contentProvider.getRootModel())); - } - - - /** - * Test {@link DiContentProvider#createFolder(ITabFolderModel, int, ITabFolderModel, int)} - */ - @Test - public void testCreateFolder() { - - // A listener on change event. - ContentChangeListener changeListener = new ContentChangeListener(); - // Set change listener - contentProvider.getContentChangedEventProvider().addListener(changeListener); - - // Add pages in the model - // Use Object as identifiers. - List identifiers = new ArrayList(); - // Add 10 pages - for (int i = 0; i < 5; i++) { - // reset change count - changeListener.reset(); - // Add Editor - Object id = new Object(); - identifiers.add(id); - contentProvider.addPage(id); - } - - // reset change count - changeListener.reset(); - // create a folder - contentProvider.createFolder(folderModel, 3, folderModel, SWT.RIGHT); - Assert.assertEquals("One event fired", 1, changeListener.getChangeCount()); - - // Check if pageIdentifier 3 have change of folder - PageRef pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(3)); - Assert.assertNotNull("Moved page have a parent", pageRef.getParent()); - Assert.assertNotSame("Moved page is in another parent", ((TabFolderModel) folderModel).getTabFolder(), pageRef.getParent()); - - // reset change count - changeListener.reset(); - // Test creating a third folder - contentProvider.createFolder(folderModel, 2, folderModel, SWT.UP); - Assert.assertEquals("One event fired", 1, changeListener.getChangeCount()); - // Check if pageIdentifier 2 have change of folder - pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(2)); - Assert.assertNotNull("Moved page have a parent", pageRef.getParent()); - Assert.assertNotSame("Moved page is in another parent", ((TabFolderModel) folderModel).getTabFolder(), pageRef.getParent()); - } - - /** - * Check if {@link DiContentProvider#setCurrentFolder(Object)}. - * Check if the method works and DO NO send any event. - */ - @Test - @NotImplemented("This test is currently deprecated; current folder cannot be set programmatically") - public void testSetCurrentFolder() { - // A listener on change event. - ContentChangeListener changeListener = new ContentChangeListener(); - // Set change listener - contentProvider.getContentChangedEventProvider().addListener(changeListener); - - // Add pages in the model - // Use Object as identifiers. - List identifiers = new ArrayList(); - // Add 10 pages - for (int i = 0; i < 5; i++) { - // reset change count - changeListener.reset(); - // Add Editor - Object id = new Object(); - identifiers.add(id); - contentProvider.addPage(id); - } - - // reset change count - changeListener.reset(); - // create a folder - contentProvider.createFolder(folderModel, 3, folderModel, SWT.RIGHT); - Assert.assertEquals("One event fired", 1, changeListener.getChangeCount()); - - - // Get the real di implementation of the first folder - TabFolder firstFolder = ((TabFolderModel) folderModel).getTabFolder(); - TabFolder createdDiFolder = contentProvider.getDiSashModel().getCurrentSelection(); - - // Check if the folder has changed - Assert.assertNotSame("current folder has change", firstFolder, createdDiFolder); - // Get the created folder - - // Try to change the current selection by setting the first folder again - changeListener.reset(); - contentProvider.setCurrentFolder(firstFolder); - // Check if really changed - Assert.assertEquals("current folder set correctly", firstFolder, contentProvider.getDiSashModel().getCurrentSelection()); - Assert.assertEquals("No event fired", 0, changeListener.getChangeCount()); - } - - - /** - * Listener on ContentChange. - * - * @author dumoulin - */ - public class ContentChangeListener implements IContentChangedListener { - - /** Count number of change event */ - private int changeCount = 0; - - - /** - * @return the changeCount - */ - public int getChangeCount() { - return changeCount; - } - - public void contentChanged(ContentEvent event) { - changeCount++; - } - - public void reset() { - changeCount = 0; - } - } - - // - // Nested types - // - - static class MyDIContentProvider extends DiContentProvider { - - MyDIContentProvider(SashModel diSashModel, IPageModelFactory pageModelFactory) throws IllegalArgumentException { - super(diSashModel, pageModelFactory); - } - - MyDIContentProvider(SashModel diSashModel, IPageModelFactory pageModelFactory, ContentChangedEventProvider contentChangedEventProvider) throws IllegalArgumentException { - super(diSashModel, pageModelFactory, contentChangedEventProvider); - } - - // Overridden to make it accessible - @Override - protected SashModel getDiSashModel() { - return super.getDiSashModel(); - } - - // Overridden to make it accessible - @Override - protected ContentChangedEventProvider getContentChangedEventProvider() { - return super.getContentChangedEventProvider(); - } - - // Overridden to make it accessible - @Override - protected void firePropertyChanged(ContentEvent event) { - super.firePropertyChanged(event); - } - - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/FakePageModelFactory.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/FakePageModelFactory.java deleted file mode 100644 index 152b4654da1..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/FakePageModelFactory.java +++ /dev/null @@ -1,37 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009 CEA LIST & LIFL - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory; - - -/** - * @author dumoulin - */ -public class FakePageModelFactory implements IPageModelFactory { - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory#createIPageModel(java.lang.Object) - * - * @param pageIdentifier - * @return - */ - public IPageModel createIPageModel(Object pageIdentifier) { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/PageManagerImplTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/PageManagerImplTest.java deleted file mode 100644 index b563cd91000..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/PageManagerImplTest.java +++ /dev/null @@ -1,486 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009, 2016 CEA LIST, LIFL, 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: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * Christian W. Damus - bug 485220 - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IAbstractPanelModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashPanelModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; -import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory; -import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.DiContentProviderTest.MyDIContentProvider; -import org.eclipse.papyrus.infra.core.sashwindows.di.AbstractPanel; -import org.eclipse.papyrus.infra.core.sashwindows.di.DiFactory; -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashWindowsMngr; -import org.eclipse.papyrus.infra.core.sashwindows.di.impl.TabFolderImpl; -import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.eclipse.swt.SWT; -import org.junit.Before; -import org.junit.Test; - - -/** - * @author dumoulin - */ -public class PageManagerImplTest extends AbstractPapyrusTest { - - /** - * The {@link PageManagerImpl} under test. - */ - protected PageManagerImpl pageMngr; - - /** - * The associated {@link DiContentProvider}. Not tested, but used to check events. - */ - protected MyDIContentProvider contentProvider; - - /** - * @see junit.framework.TestCase#setUp() - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - SashWindowsMngr diSashModel = DiUtils.createDefaultSashWindowsMngr(); - - // Fix bug to match refactoring in Bug 429239. The current implementation computes allPages() dynamically, - // and doesn't support addPage() and removePage() anymore - // Because this test is used in a different context, where allPages() cannot be computed dynamically, - // we need to create a specific setup - diSashModel.setPageList(DiFactory.eINSTANCE.createPageList()); - ContentChangedEventProvider eventProvider = new ContentChangedEventProvider(diSashModel); - pageMngr = new PageManagerImpl(diSashModel, eventProvider) { - @Override - protected boolean isLegacyMode() { - return true; - } - }; - - IPageModelFactory pageModelFactory = new FakePageModelFactory(); - contentProvider = new MyDIContentProvider(diSashModel.getSashModel(), pageModelFactory, eventProvider); - - } - - /** - * Lookup for a folder in the SashModel. Return the first folder found. - * - * @return - */ - private ITabFolderModel lookupFolderModel() { - if (contentProvider == null) { - return null; - } - - Object rawModel = contentProvider.getRootModel(); - // Create the requested model suitable for the folder. - // It is possible (but not recommended) to create several models for the same object. - // We can avoid this by using a Map of created models. - IAbstractPanelModel panelModel = contentProvider.createChildSashModel(rawModel); - - return lookupFolderModel(panelModel); - } - - /** - * Recursively search in sash models for a FolderModel. - * Return the first encountered folder. - * - * @param panelModel - * @return - */ - private ITabFolderModel lookupFolderModel(IAbstractPanelModel panelModel) { - - if (panelModel instanceof ITabFolderModel) { - return (ITabFolderModel) panelModel; - } else { - ISashPanelModel sashModel = (ISashPanelModel) panelModel; - // Iterate on children - for (Object child : sashModel.getChildren()) { - IAbstractPanelModel childModel = contentProvider.createChildSashModel(child); - ITabFolderModel res = lookupFolderModel(childModel); - if (res != null) { - return res; - } - } - } - // Not found - return null; - } - - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageMngrImpl#addPage(org.eclipse.emf.ecore.EObject)}. - */ - @Test - public void testAddPage() { - // A listener on change event. - ContentChangeListener changeListener = new ContentChangeListener(); - - // Set change listener - contentProvider.getContentChangedEventProvider().addListener(changeListener); - - // Add identifiers - // Use Object as identifiers. - List identifiers = new ArrayList(); - // Add 10 folders - for (int i = 0; i < 10; i++) { - // reset change count - changeListener.reset(); - // Add Editor - Object id = new Object(); - identifiers.add(id); - pageMngr.addPage(id); - - // Check no fired events - assertEquals("One event fired", 0, changeListener.getChangeCount()); - } - - // Check if pages are in PageList - assertEquals("all pages added", 10, pageMngr.allPages().size()); - - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageMngrImpl#allPages()}. - */ - @Test - public void testAllPages() { - // A listener on change event. - ContentChangeListener changeListener = new ContentChangeListener(); - - // Set change listener - contentProvider.getContentChangedEventProvider().addListener(changeListener); - - // Add identifiers - // Use Object as identifiers. - List identifiers = new ArrayList(); - // Add 10 folders - for (int i = 0; i < 10; i++) { - // reset change count - changeListener.reset(); - // Add Editor - Object id = new Object(); - identifiers.add(id); - pageMngr.openPage(id); - - // Check fired events - assertEquals("One event fired", 1, changeListener.getChangeCount()); - } - // Check if pages are in PageList - assertEquals("all pages found", 10, pageMngr.allPages().size()); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageMngrImpl#closePage(org.eclipse.emf.ecore.EObject)}. - */ - @Test - public void testClosePage() { - // A listener on change event. - ContentChangeListener changeListener = new ContentChangeListener(); - - // Set change listener - contentProvider.getContentChangedEventProvider().addListener(changeListener); - - // Add identifiers - // Use Object as identifiers. - List identifiers = new ArrayList(); - // Add 10 folders - for (int i = 0; i < 10; i++) { - // reset change count - changeListener.reset(); - // Add Editor - Object id = new Object(); - identifiers.add(id); - pageMngr.openPage(id); - - // Check fired events - assertEquals("One event fired", 1, changeListener.getChangeCount()); - } - // Check if pages are in PageList - assertEquals("all pages added", 10, pageMngr.allPages().size()); - - // Close page - changeListener.reset(); - pageMngr.closePage(identifiers.get(3)); - - // Check fired events - assertEquals("One event fired", 1, changeListener.getChangeCount()); - - // Check page still in pages - assertEquals("all pages still in list", 10, pageMngr.allPages().size()); - - // Check if pages are in SashStructure - PageRef pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(3)); - assertNull("Page removed from sashStructure ", pageRef); - - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageMngrImpl#closeAllOpenedPages())}. - */ - @Test - public void testCloseAllOpenedPages() { - // A listener on change event. - ContentChangeListener changeListener = new ContentChangeListener(); - - // Set change listener - contentProvider.getContentChangedEventProvider().addListener(changeListener); - - // Add identifiers - // Use Object as identifiers. - List identifiers = new ArrayList(); - // Add 10 folders - for (int i = 0; i < 10; i++) { - // reset change count - changeListener.reset(); - // Add Editor - Object id = new Object(); - identifiers.add(id); - pageMngr.openPage(id); - - // Check fired events - assertEquals("One event fired", 1, changeListener.getChangeCount()); - } - // Check if pages are in PageList - assertEquals("all pages added", 10, pageMngr.allPages().size()); - - // Close page - changeListener.reset(); - pageMngr.closeAllOpenedPages(); - - // Check fired events - assertEquals("One event fired", 1, changeListener.getChangeCount()); - - // Check page still in pages - assertEquals("all pages still in list", 10, pageMngr.allPages().size()); - - // Check if pages are in SashStructure - for (int i = 0; i < 10; i++) { - PageRef pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(i)); - assertNull("Page " + i + " removed from sashStructure ", pageRef); - } - - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageMngrImpl#closeAllOpenedPages())}. - */ - @Test - public void testCloseOtherOpenedPages() { - // A listener on change event. - ContentChangeListener changeListener = new ContentChangeListener(); - - // Set change listener - contentProvider.getContentChangedEventProvider().addListener(changeListener); - - // Add identifiers - // Use Object as identifiers. - List identifiers = new ArrayList(); - // Add 10 folders - for (int i = 0; i < 10; i++) { - // reset change count - changeListener.reset(); - // Add Editor - Object id = new Object(); - identifiers.add(id); - pageMngr.openPage(id); - - // Check fired events - assertEquals("One event fired", 1, changeListener.getChangeCount()); - } - // Check if pages are in PageList - assertEquals("all pages added", 10, pageMngr.allPages().size()); - - // Close page - changeListener.reset(); - pageMngr.closeOtherPages(identifiers.get(3)); - - // Check fired events - assertEquals("One event fired", 1, changeListener.getChangeCount()); - - // Check page still in pages - assertEquals("all pages still in list", 10, pageMngr.allPages().size()); - - // Check if pages are in SashStructure - for (int i = 0; i < 10; i++) { - PageRef pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(i)); - if (i != 3) { - assertNull("Page " + i + " removed from sashStructure ", pageRef); - } else { - assertNotNull("Page " + i + " not removed from sashStructure ", pageRef); - } - } - - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageMngrImpl#openPage(org.eclipse.emf.ecore.EObject)}. - */ - @Test - public void testOpenPage() { - // A listener on change event. - ContentChangeListener changeListener = new ContentChangeListener(); - - // Set change listener - contentProvider.getContentChangedEventProvider().addListener(changeListener); - - // Add identifiers - // Use Object as identifiers. - List identifiers = new ArrayList(); - // Add 10 folders - for (int i = 0; i < 10; i++) { - // reset change count - changeListener.reset(); - // Add Editor - Object id = new Object(); - identifiers.add(id); - pageMngr.openPage(id); - - // Check fired events - assertEquals("One event fired", 1, changeListener.getChangeCount()); - } - - // Check if pages are in PageList - assertEquals("all pages added", 10, pageMngr.allPages().size()); - - // Check if pages are in SashStructure - PageRef pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(3)); - assertNotNull("Page exist in sashStructure ", pageRef); - assertSame("found the right page", identifiers.get(3), pageRef.getPageIdentifier()); - - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageMngrImpl#removePage(org.eclipse.emf.ecore.EObject)}. - */ - @Test - public void testRemovePage() { - // A listener on change event. - ContentChangeListener changeListener = new ContentChangeListener(); - - // Set change listener - contentProvider.getContentChangedEventProvider().addListener(changeListener); - - // Add identifiers - // Use Object as identifiers. - List identifiers = new ArrayList(); - // Add 10 folders - for (int i = 0; i < 10; i++) { - // reset change count - changeListener.reset(); - // Add Editor - Object id = new Object(); - identifiers.add(id); - pageMngr.openPage(id); - - // Check fired events - assertEquals("One event fired", 1, changeListener.getChangeCount()); - } - // Check if pages are in PageList - assertEquals("all pages added", 10, pageMngr.allPages().size()); - // Check if page id is in page list - assertTrue("check page id is added to page list", pageMngr.allPages().contains(identifiers.get(3))); - - // Close page - changeListener.reset(); - pageMngr.removePage(identifiers.get(3)); - - // Check fired events - assertEquals("One event fired", 1, changeListener.getChangeCount()); - - // Check page still in pages - assertEquals("page remove from list", 9, pageMngr.allPages().size()); - - // Check removed from page list - assertFalse("check removed from page list", pageMngr.allPages().contains(identifiers.get(3))); - - // Check if pages are in SashStructure - PageRef pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(3)); - assertNull("Page removed from sashStructure ", pageRef); - } - - /** - * Check if closing the last page in a second tabfolder work propoerly. - * Create 3 editors, move one in a new folder, then remove the moved one. - * The new folder should automatically be removed. - * - */ - @Test - public void testCloseLastPageOfTabFolder() { - // A listener on change event. - ContentChangeListener changeListener = new ContentChangeListener(); - - // Set change listener - contentProvider.getContentChangedEventProvider().addListener(changeListener); - - // Create 3 editors, move one in another table - // Then remove the moved one. - - // Add identifiers - // Use Object as identifiers. - List identifiers = new ArrayList(); - // Add pages - int pageCount = 3; - for (int i = 0; i < pageCount; i++) { - // Add Editor - Object id = new Object(); - identifiers.add(id); - pageMngr.openPage(id); - } - // Check if pages are in PageList - assertEquals("all pages added", pageCount, pageMngr.allPages().size()); - - - // Move the last page - int movedPageIndex = 0; - ITabFolderModel tabFolder = lookupFolderModel(); - assertTrue("Moved page index is valid", movedPageIndex < pageCount); - - contentProvider.createFolder(tabFolder, movedPageIndex, tabFolder, SWT.TOP); - // check if the folder is created - // List folders = getAllFolders(contentProvider.getDiSashModel()); - // assertEquals("additional folder is removed", 2, folders.size()); - - // Close page - pageMngr.closePage(identifiers.get(movedPageIndex)); - - // Check the resulting model: we should have one folder with two page. - // folders = getAllFolders(contentProvider.getDiSashModel()); - // assertEquals("additional folder is removed", 1, folders.size()); - - List children = contentProvider.getDiSashModel().getWindows().get(0).getChildren(); - assertEquals("Windows has one child", 1, children.size()); - assertEquals("Windows child is the tabfolder", TabFolderImpl.class, children.get(0).getClass()); - - // Check if pages are in SashStructure - PageRef pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(movedPageIndex)); - assertNull("Page removed from sashStructure ", pageRef); - - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/QueryVisitor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/QueryVisitor.java deleted file mode 100644 index 0d3b5006ade..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/QueryVisitor.java +++ /dev/null @@ -1,138 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelObject; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; -import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; -import org.eclipse.papyrus.infra.core.sashwindows.di.Window; - -/** - * Visitor used to collect element in the model. - * Each element in the model associated with a{@link IQueryTerm} whose name is set is collectted. - * The collected element is then accessible from the result map, using the name set in the IQueryTerm. - * - * - * @author cedric dumoulin - * - */ -public class QueryVisitor extends DiContentProviderBaseVisitor implements IPagesModelVisitor { - - /** - * The result map. - */ - protected Mapresult = new HashMap(); - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) - * - * @param windowTerm - * @param windowModel - */ - @Override - public void visit(WindowTerm windowTerm, Window windowModel) { - collect( windowTerm, windowModel); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder, org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder) - * - * @param folder - * @param folderModel - */ - @Override - public void visit(Folder folder, TabFolder folderModel) { - collect(folder, folderModel); - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) - * - * @param sash - * @param sashModel - */ - @Override - public void visit(HSash sash, SashPanel sashModel) { - collect(sash, sashModel); - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) - * - * @param sash - * @param sashModel - */ - @Override - public void visit(VSash sash, SashPanel sashModel) { - collect(sash, sashModel); - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page, org.eclipse.papyrus.infra.core.sashwindows.di.PageRef) - * - * @param page - * @param pageModel - */ - @Override - public void visit(Page page, PageRef pageModel) { - collect(page, pageModel); - - } - - /** - * Add the element associated to the query to the result, if the query has a name. - * @param iQueryTerm - * @param element - */ - protected void collect( IModelObject iQueryTerm, Object element) { - - if( iQueryTerm.getName() == null) { - return; - } - - result.put(iQueryTerm.getName(), element); - } - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#isVisitingParentFirst() - * - * @return - */ - @Override - public boolean isVisitingParentFirst() { - return true; - } - - /** - * @return the result - */ - public Map getResult() { - return result; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/SashContainerModels.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/SashContainerModels.java deleted file mode 100644 index fd881050514..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/SashContainerModels.java +++ /dev/null @@ -1,63 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; - -/** - * A class used to translate di models to {@link ISashWindowsContentProvider} models. - * - * - * @author cedric dumoulin - * - */ -public class SashContainerModels { - - protected Map diModelElements; - - protected Map cache = new HashMap(); - - protected DiContentProvider diContentProvider; - /** - * Constructor. - * - * @param diModelElements - */ - public SashContainerModels(DiContentProvider diContentProvider, Map diModelElements) { - this.diModelElements = diModelElements; - this.diContentProvider = diContentProvider; - } - - - /** - * @param string - * @return - */ - public ITabFolderModel getFolder(String name) { - - ITabFolderModel result = (ITabFolderModel)cache.get(name); - if(result==null) { - // Create container model and cache it - result = (ITabFolderModel)diContentProvider.createChildSashModel(diModelElements.get(name)); - - cache.put(name, result); - } - return result; - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/TransactionalDiContentProvider2Test.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/TransactionalDiContentProvider2Test.java deleted file mode 100644 index 3cf23254804..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/TransactionalDiContentProvider2Test.java +++ /dev/null @@ -1,170 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; - -import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.folder; -import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.page; - -import java.util.Map; - -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory; -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryExp; -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.QueryException; -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; -import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * @author dumoulin - * - */ -public class TransactionalDiContentProvider2Test extends AbstractDiContentProviderTest { - - protected TransactionalEditingDomain editingDomain; - - /* - * - */ - @Before - public void setUp() throws Exception { - - editingDomain = TransactionalEditingDomain.Factory.INSTANCE.createEditingDomain(); - - - // Register the default resource factory -- only needed for stand-alone! - editingDomain.getResourceSet().getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); - - - final Resource resource = editingDomain.createResource("temp.di"); - - IPageModelFactory pageModelFactory = new FakePageModelFactory(); - final SashModel diSashModel = DiUtils.createDefaultSashModel(); - - // Add model to ResourceSet - editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) { - - @Override - protected void doExecute() { - resource.getContents().add(diSashModel); - } - }); - - - diContentProvider = new DiContentProvider(diSashModel, pageModelFactory); - - - - contentProvider = new TransactionalDiContentProvider(diContentProvider, editingDomain); - // Create model query - modelQuery = new SashModelQuery(diSashModel); - } - - /** - * - * @see junit.framework.TestCase#tearDown() - * - * @throws Exception - */ - @After - public void tearDown() throws Exception { - editingDomain.dispose(); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.AbstractDiContentProviderTest#createModel(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm) - * - * @param query - * @throws QueryException - */ - @Override - protected void createModel(final IQueryExp query) throws QueryException { - editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) { - - @Override - protected void doExecute() { - try { - modelQuery.createModel(query); - } catch (QueryException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - - } - - /** - * Test undo/Redo moving a page inside the same folder - * - * @throws QueryException - */ - @Test - public void testUndoRedoMovePageInsideFolder() throws QueryException { - - // Create a folder with several page - IQueryExp query1 = folder("f1", page("p1"), page("p2"), page("p3")); - createModel(query1); - // Check creation - modelQuery.assertConform(query1); - - // get models (from diModels, and factory for sashModel) - Map modelElements = modelQuery.queryModel(query1); - final SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); - - // do action : move a page - //Fix test after refactoring in Bug 429239: by default, the contentProvider actions are transactional, but not undoable - //Create a recording command to force it to be undoable - RecordingCommand movePageCommand = new RecordingCommand(editingDomain, "Move page") { - - @Override - protected void doExecute() { - contentProvider.movePage(sashModels.getFolder("f1"), 1, 0); - } - }; - editingDomain.getCommandStack().execute(movePageCommand); - //End of fix for Bug 429239 - - // check result - IQueryExp query2 = folder("f1", page("p2"), page("p1"), page("p3")); - modelQuery.assertConform(query2); - - // do action : undo - editingDomain.getCommandStack().undo(); - // check result - modelQuery.assertConform(query1); - - // do action : redo - editingDomain.getCommandStack().redo(); - // check result - modelQuery.assertConform(query2); - - // do action : undo - editingDomain.getCommandStack().undo(); - // check result - modelQuery.assertConform(query1); - - // do action : redo - editingDomain.getCommandStack().redo(); - // check result - modelQuery.assertConform(query2); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/AbstractSash.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/AbstractSash.java deleted file mode 100644 index 6d7dafccfac..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/AbstractSash.java +++ /dev/null @@ -1,97 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -import org.eclipse.emf.ecore.EObject; - -/** - * Base class for structure representing sash in Checker - * @author cedric dumoulin - * - */ -public abstract class AbstractSash extends PanelTerm { - - protected PanelTerm leftup; - protected PanelTerm rightdown; - - /** - * Constructor. - * - */ - public AbstractSash(PanelTerm left, PanelTerm right) { - this.leftup = left; - this.rightdown = right; - } - - /** - * Constructor. - * - * @param name - * @param up - * @param down - */ - public AbstractSash(String name, PanelTerm left, PanelTerm right) { - super(name); - this.leftup = left; - this.rightdown = right; - } - - /** - * @return the leftup - */ - public PanelTerm getLeftup() { - return leftup; - } - - /** - * @return the rightdown - */ - public PanelTerm getRightdown() { - return rightdown; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor) - * - * @param visitor - * @throws QueryException - */ - abstract public void accept(IQueryVisitor visitor, EObject modelObject) throws QueryException ; - - /** - * @return The name used in toString - */ - protected abstract String getStringName(); - - /** - * @see java.lang.Object#toString() - * - * @return - */ - @Override - public String toString() { - - StringBuffer buff = new StringBuffer(getStringName()); - - buff.append("("); - buff.append(leftup.toString()); - buff.append(", "); - buff.append(rightdown.toString()); - buff.append(")"); - - return buff.toString(); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CheckVisitor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CheckVisitor.java deleted file mode 100644 index c85b51ced4c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CheckVisitor.java +++ /dev/null @@ -1,97 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; -import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; - - -/** - * @author cedric dumoulin - * - */ -public class CheckVisitor implements IQueryVisitor { - - /** - * @return the isVisitingParentFirst - */ - public boolean isVisitingParentFirst() { - return false; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) - * - * @param windowTerm - * @param windowModel - */ - public void visit(WindowTerm windowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window windowModel) { - // TODO Auto-generated method stub - - } - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder) - * - * @param folder - */ - public void visit(Folder folder, TabFolder folderModel) { - // Check name - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash) - * - * @param sash - */ - public void visit(HSash sash, SashPanel sashModel) { - // TODO Auto-generated method stub - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash) - * - * @param sash - */ - public void visit(VSash sash , SashPanel sashModel) { - // TODO Auto-generated method stub - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page) - * - * @param page - * @throws NoMatchException - */ - public void visit(Page page, PageRef pageModel) throws QueryException { - //check name - if(page.getIdentifier() != null) { - checkName(page.getIdentifier(), pageModel.getPageIdentifier()) ; - } - else if(page.getName() != null) { - checkName(page.getName(), pageModel.getPageIdentifier()) ; - } - } - - - protected void checkName( Object expectedName, Object foundName) throws NoMatchException { - if( expectedName != foundName ) - throw new NoMatchException( "Names do not match (expected=" - + expectedName + ", found="+ foundName ); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CreateModelVisitor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CreateModelVisitor.java deleted file mode 100644 index 6f8b51d92d8..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CreateModelVisitor.java +++ /dev/null @@ -1,138 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -import org.eclipse.papyrus.infra.core.sashwindows.di.DiFactory; -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; -import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; -import org.eclipse.papyrus.infra.core.sashwindows.di.Window; -import org.eclipse.swt.SWT; - -/** - * This visitor is used with {@link IQueryTerm} to create a {@link SashModel} instancied - * with the Sash, folders and pages specified in the query. - * - * - * @author cedric dumoulin - * - */ -public class CreateModelVisitor implements IQueryVisitor { - - /** - * @return the isVisitingParentFirst - */ - public boolean isVisitingParentFirst() { - return true; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) - * - * @param windowTerm - * @param windowModel - */ - public void visit(WindowTerm windowTerm, Window windowModel) { - // Create children of the sash - PanelTerm panel = windowTerm.getPanel(); - if(panel instanceof AbstractSash) { - windowModel.setPanel(DiFactory.eINSTANCE.createSashPanel()); - } - else if (panel instanceof Folder) { - windowModel.setPanel(DiFactory.eINSTANCE.createTabFolder()); - } - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder, org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder) - * - * @param folder - * @param folderModel - */ - public void visit(Folder folder, TabFolder folderModel) { - - // Create children of the folder - for( Page page : folder.getPages() ) { - folderModel.getChildren().add(DiFactory.eINSTANCE.createPageRef()); - } - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) - * - * @param sashQuery - * @param sashModel - */ - public void visit(HSash sashQuery, SashPanel sashModel) { - - // sash orientation - sashModel.setDirection(SWT.HORIZONTAL); - // Create children of the sash - - createPanelOrFolder(sashQuery.leftup, sashModel); - createPanelOrFolder(sashQuery.rightdown, sashModel); - } - - /** - * @param sashModel - * @param panel - */ - private void createPanelOrFolder(PanelTerm panel, SashPanel parent ) { - if(panel instanceof AbstractSash) { - parent.getChildren().add(DiFactory.eINSTANCE.createSashPanel()); - } - else if (panel instanceof Folder) { - parent.getChildren().add(DiFactory.eINSTANCE.createTabFolder()); - } - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) - * - * @param sash - * @param sashModel - */ - public void visit(VSash sashQuery, SashPanel sashModel) { - // sash orientation - sashModel.setDirection(SWT.VERTICAL); - // Create children of the sash - createPanelOrFolder(sashQuery.leftup, sashModel); - createPanelOrFolder(sashQuery.rightdown, sashModel); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page, org.eclipse.papyrus.infra.core.sashwindows.di.PageRef) - * - * @param page - * @param pageModel - */ - public void visit(Page page, PageRef pageModel) { - - - if(page.getIdentifier() != null) { - pageModel.setPageIdentifier(page.getIdentifier()); - } - else if(page.getName() != null) { - pageModel.setPageIdentifier(page.getName()); - } - else { - pageModel.setPageIdentifier(new Object()); - } - - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Folder.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Folder.java deleted file mode 100644 index bbc0ccf7192..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Folder.java +++ /dev/null @@ -1,126 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; -import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; - -/** - * This represent a Folder in the Checker query. - * - * @author cedric dumoulin - */ -public class Folder extends PanelTerm implements IQueryTerm { - - protected List pages; - - /** - * Constructor. - * - */ - public Folder(Page ... pages) { - this.pages = Arrays.asList(pages); - } - - /** - * Constructor. - * - */ - public Folder(String name, Page ... pages) { - super(name); - this.pages = Arrays.asList(pages); - } - - /** - * @return the pages - */ - public List getPages() { - return pages; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm#accept(IQueryVisitor, EObject) - * - * @param visitor - * @throws QueryException - */ - public void accept(IQueryVisitor visitor, EObject modelObject) throws QueryException { - - // Check associated model type - if(! (modelObject instanceof TabFolder) ) { - throw new NoMatchException( this.toString() + " - Model object type does not match to FolderQueryPart" ); - } - TabFolder folderModel = (TabFolder)modelObject; - - // Visit this - if( visitor.isVisitingParentFirst() ) { - visitor.visit(this, folderModel); - } - - // visit children - Iterator pageRefs = folderModel.getChildren().iterator(); - Iterator pageQueries = pages.iterator(); - while (pageRefs.hasNext() && pageQueries.hasNext() ) { - PageRef pageRef = pageRefs.next(); - Page query = pageQueries.next(); - - query.accept(visitor, pageRef); - } - if (pageRefs.hasNext()) { - // some page left - throw new NoMatchException( "Folder matching - " - + this.toString() - +" folder model have more pages than folder query." ); - } else if (pageQueries.hasNext() ) { - // some queries left - throw new NoMatchException( "Folder matching - " - + this.toString() - +" folder query have more page than folder model." ); - } - - // Visit this - if( ! visitor.isVisitingParentFirst() ) { - visitor.visit(this, folderModel); - } - } - - /** - * @see java.lang.Object#toString() - * - * @return - */ - @Override - public String toString() { - - StringBuffer buff = new StringBuffer("Folder("); - - for(Page page : pages ) { - buff.append(page.toString()).append(", "); - } - // Remove extra , - int length = buff.length(); - if(buff.charAt(length-1) == ' ') { - buff.delete(length-2, length ); - } - buff.append(")"); - - return buff.toString(); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/HSash.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/HSash.java deleted file mode 100644 index f6246370437..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/HSash.java +++ /dev/null @@ -1,87 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; - -/** - * @author dumoulin - * - */ -public class HSash extends AbstractSash { - - /** - * Constructor. - * - * @param leftup - * @param rightdown - */ - public HSash(PanelTerm up, PanelTerm down) { - super(up, down); - } - - /** - * Constructor. - * - * @param leftup - * @param rightdown - */ - public HSash(String name, PanelTerm up, PanelTerm down) { - super(name, up, down); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm#accept(IQueryVisitor, EObject) - * - * @param visitor - * @throws QueryException - */ - public void accept(IQueryVisitor visitor, EObject modelObject) throws QueryException { - // Check associated model type - if(! (modelObject instanceof SashPanel) ) { - throw new NoMatchException( this.toString() + " - Model object type does not match to SashPanel (found " - + modelObject.getClass() - + " )"); - } - - SashPanel sashModel = (SashPanel)modelObject; - - // Visit this - if( visitor.isVisitingParentFirst() ) { - visitor.visit(this, sashModel); - } - - // Visit children - leftup.accept(visitor, sashModel.getChildren().get(0)); - rightdown.accept(visitor, sashModel.getChildren().get(1)); - - if( !visitor.isVisitingParentFirst() ) { - visitor.visit(this, sashModel); - } - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.AbstractSash#getStringName() - * - * @return - */ - @Override - protected String getStringName() { - return "HSash"; - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryExp.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryExp.java deleted file mode 100644 index 82c67c8dbce..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryExp.java +++ /dev/null @@ -1,28 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -/** - * A Query Expression represent an expression used to query a SashModel. - * Term implementing this interface can be used as starting point of expression. - *
- * Following classses are expressions: {@link PanelTerm}, {@link WindowTerm}. - * - * @author cedric dumoulin - * - */ -public interface IQueryExp extends IQueryTerm { - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryTerm.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryTerm.java deleted file mode 100644 index 86865a79271..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryTerm.java +++ /dev/null @@ -1,40 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -import org.eclipse.emf.ecore.EObject; - -/** - * A Query term is a part of a Query expression. - * All term that can be used in a query should implement this interface. - * - * @author cedric dumoulin - * - */ -public interface IQueryTerm { - - /** - * Visit the query. - * @param visitor - * @throws QueryException - */ - public void accept(IQueryVisitor visitor, EObject panel) throws QueryException; - - /** - * Get the name associated to the query part. - * Can return null; - */ - public String getName(); -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryVisitor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryVisitor.java deleted file mode 100644 index 804a9f5289f..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryVisitor.java +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; -import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; - -/** - * Visitor used to visit query structure. - * - * @author cedric dumoulin - * - */ -public interface IQueryVisitor { - - public void visit( WindowTerm windowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window windowModel ); - public void visit( Folder folder, TabFolder folderModel ); - - public void visit(HSash sash, SashPanel sashModel); - public void visit(VSash sash, SashPanel sashModel); - - public void visit(Page page, PageRef pageModel) throws QueryException; - - /** - * If true, parent are visited before children. - * If false, parent are visited after children. - * @return - */ - public boolean isVisitingParentFirst(); - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/NoMatchException.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/NoMatchException.java deleted file mode 100644 index 6a6af1c79e7..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/NoMatchException.java +++ /dev/null @@ -1,77 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -/** - * Exception thrown when a query part does not match a modelpart. - * - * @author cedric dumoulin - * - */ -public class NoMatchException extends QueryException { - - /** - * - */ - private static final long serialVersionUID = 1L; - - /** - * Constructor. - * - */ - public NoMatchException() { - } - - /** - * Constructor. - * - * @param arg0 - */ - public NoMatchException(String arg0) { - super(arg0); - } - - /** - * Constructor. - * - * @param arg0 - */ - public NoMatchException(Throwable arg0) { - super(arg0); - } - - /** - * Constructor. - * - * @param arg0 - * @param arg1 - */ - public NoMatchException(String arg0, Throwable arg1) { - super(arg0, arg1); - } - - /** - * Constructor. - * - * @param arg0 - * @param arg1 - * @param arg2 - * @param arg3 - */ - public NoMatchException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { - super(arg0, arg1, arg2, arg3); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Page.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Page.java deleted file mode 100644 index b709a4e74c4..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Page.java +++ /dev/null @@ -1,117 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; - -/** - * This represent a page in the Checker query. - * - * @author cedric dumoulin - * - */ -public class Page implements IQueryTerm { - - protected Object identifier; - - protected String name; - - /** - * Constructor. - * - */ - public Page() { - - } - - /** - * Constructor. - * - * @param identifier - */ - public Page(Object identifier) { - this.identifier = identifier; - } - - /** - * Constructor. - * - * @param name - * @param identifier - */ - public Page(String name) { - this.name = name; - this.identifier = name; - } - - /** - * Constructor. - * - * @param name - * @param identifier - */ - public Page(String name, Object identifier) { - this.name = name; - this.identifier = identifier; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm#accept(IQueryVisitor, EObject) - * - * @param visitor - * @throws QueryException - */ - public void accept(IQueryVisitor visitor, EObject modelObject) throws QueryException { - // Check associated model type - if(! (modelObject instanceof PageRef) ) { - throw new NoMatchException( this.toString() + " - Model object type does not match to PageRef" ); - } - PageRef pageRef = (PageRef)modelObject; - visitor.visit(this, pageRef); - } - - /** - * @return the identifier - */ - public Object getIdentifier() { - return identifier; - } - - /** - * @param identifier the identifier to set - */ - public void setIdentifier(Object identifier) { - this.identifier = identifier; - } - - /** - * @see java.lang.Object#toString() - * - * @return - */ - @Override - public String toString() { - - return "Page()"; - } - - /** - * @return the name - */ - public String getName() { - return name; - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/PanelTerm.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/PanelTerm.java deleted file mode 100644 index c04cf02c4e2..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/PanelTerm.java +++ /dev/null @@ -1,76 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -import org.eclipse.emf.ecore.EObject; - -/** - * Common ancestor of Panel (Folder and Sash) in queries structure. - *
- * This class can also be used a starting point of query expression (and so Folder, VSash and HSash). - * - * @author cedric dumoulin - * - */ -public abstract class PanelTerm implements IQueryExp { - - protected String name; - - - /** - * Constructor. - * - */ - public PanelTerm() { - // TODO Auto-generated constructor stub - } - - /** - * Constructor. - * - * @param name - */ - public PanelTerm(String name) { - this.name = name; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm#accept(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor, org.eclipse.emf.ecore.EObject) - * - * @param visitor - * @param panel - * @throws QueryException - */ - public void accept(IQueryVisitor visitor, EObject panel) - throws QueryException { - // TODO Auto-generated method stub - - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @param name the name to set - */ - public void setName(String name) { - this.name = name; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryException.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryException.java deleted file mode 100644 index 698301dcc9d..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryException.java +++ /dev/null @@ -1,77 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -/** - * Root Exception of the query package - * - * @author cedric dumoulin - * - */ -public class QueryException extends Exception { - - /** - * - */ - private static final long serialVersionUID = 1L; - - /** - * Constructor. - * - */ - public QueryException() { - } - - /** - * Constructor. - * - * @param arg0 - */ - public QueryException(String arg0) { - super(arg0); - } - - /** - * Constructor. - * - * @param arg0 - */ - public QueryException(Throwable arg0) { - super(arg0); - } - - /** - * Constructor. - * - * @param arg0 - * @param arg1 - */ - public QueryException(String arg0, Throwable arg1) { - super(arg0, arg1); - } - - /** - * Constructor. - * - * @param arg0 - * @param arg1 - * @param arg2 - * @param arg3 - */ - public QueryException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { - super(arg0, arg1);//, arg2, arg3); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryVisitor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryVisitor.java deleted file mode 100644 index 5e6aaba10bf..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryVisitor.java +++ /dev/null @@ -1,124 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; -import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; -import org.eclipse.papyrus.infra.core.sashwindows.di.Window; - -/** - * Visitor used to collect element in the model. - * Each element in the model associated with a{@link IQueryTerm} whose name is set is collectted. - * The collected element is then accessible from the result map, using the name set in the IQueryTerm. - * - * - * @author cedric dumoulin - * - */ -public class QueryVisitor implements IQueryVisitor { - - /** - * The result map. - */ - protected Mapresult = new HashMap(); - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) - * - * @param windowTerm - * @param windowModel - */ - public void visit(WindowTerm windowTerm, Window windowModel) { - collect( windowTerm, windowModel); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder, org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder) - * - * @param folder - * @param folderModel - */ - public void visit(Folder folder, TabFolder folderModel) { - collect(folder, folderModel); - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) - * - * @param sash - * @param sashModel - */ - public void visit(HSash sash, SashPanel sashModel) { - collect(sash, sashModel); - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) - * - * @param sash - * @param sashModel - */ - public void visit(VSash sash, SashPanel sashModel) { - collect(sash, sashModel); - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page, org.eclipse.papyrus.infra.core.sashwindows.di.PageRef) - * - * @param page - * @param pageModel - */ - public void visit(Page page, PageRef pageModel) { - collect(page, pageModel); - - } - - /** - * Add the element associated to the query to the result, if the query has a name. - * @param iQueryTerm - * @param element - */ - protected void collect( IQueryTerm iQueryTerm, Object element) { - - if( iQueryTerm.getName() == null) { - return; - } - - result.put(iQueryTerm.getName(), element); - } - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#isVisitingParentFirst() - * - * @return - */ - public boolean isVisitingParentFirst() { - return true; - } - - /** - * @return the result - */ - public Map getResult() { - return result; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQuery.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQuery.java deleted file mode 100644 index 7d98b85d88b..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQuery.java +++ /dev/null @@ -1,220 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -import java.util.Map; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.core.sashwindows.di.AbstractPanel; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashWindowsMngr; -import org.eclipse.papyrus.infra.core.sashwindows.di.Window; - -/** - * Class used to check and query (from tests) the DiContentProvider. - *
- * This class also provide a set of static constructor helping in writing query. - *
- * Examples: - *
    - *
  • PanelTerm query = folder("a", page(), page() );
  • - *
  • query = hSash( folder( page("p1"), page() ), vSash("s2", folder( page() ), folder( page() )) );
  • - *
  • PanelTerm query = hSash( folder("f1", page("p1"), page("p2"), page("p3") ), folder("f2", page("p4") ) );
  • - *
  • - *
- * @author cedric dumoulin - * - */ -public class SashModelQuery { - - /** - * Model to query. - */ - protected SashModel sashModel; - - /** - * Static constructor for {@link Page}. - * @return - */ - static public Page page() { - return new Page(); - } - - /** - * Static constructor for {@link Page}. - * @return - */ - static public Page page(String name) { - return new Page(name); - } - - /** - * Static constructor for {@link Folder}. - * @return - */ - static public Folder folder( Page ...pages ) { - return new Folder(pages); - } - - /** - * Static constructor for {@link Folder}. - * @return - */ - static public Folder folder( String name, Page ...pages ) { - return new Folder(name, pages); - } - - /** - * Static constructor for {@link VSash}. - * @return - */ - static public VSash vSash( String name, PanelTerm up, PanelTerm down) { - return new VSash(name, up, down); - } - - /** - * Static constructor for {@link VSash}. - * @return - */ - static public VSash vSash( PanelTerm up, PanelTerm down) { - return new VSash(up, down); - } - - /** - * Static constructor for {@link HSash}. - * @return - */ - static public HSash hSash( String name, PanelTerm left, PanelTerm right) { - return new HSash(name, left, right); - } - - /** - * Static constructor for {@link HSash}. - * @return - */ - static public HSash hSash( PanelTerm left, PanelTerm right) { - return new HSash(left, right); - } - - /** - * Constructor. - * - * @param modelMngr - */ - public SashModelQuery(SashWindowsMngr modelMngr) { - this.sashModel = modelMngr.getSashModel(); - } - - /** - * Constructor. - * - * @param sashModel - */ - public SashModelQuery(SashModel sashModel) { - this.sashModel = sashModel; - } - - - /** - * Check if the sashModel is conformed to the specified query. - * @param query - * @throws QueryException - */ - public void assertConform(IQueryExp query) throws QueryException { - - EObject first; - if( query instanceof WindowTerm) { - first = getFirstWindowModel(); - } - else if( query instanceof PanelTerm) { - first = getFirstPanelModel(); - } - else { - throw new QueryException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); - } - - CheckVisitor visitor = new CheckVisitor(); - query.accept(visitor, first); - } - - /** - * Create an internal model conform to the specified query. - * Any previous model is disguarded. - * - * @param query Should be a subtype PanelTerm (Folder, HSash, VSash) - * @throws QueryException - */ - public void createModel(IQueryExp query) throws QueryException { - - Window first; - if( query instanceof PanelTerm) { - first = getFirstWindowModel(); - } - else { - throw new QueryException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); - } - - // Create a surrounding WindowTerm - WindowTerm windowTerm = new WindowTerm((PanelTerm)query); - - CreateModelVisitor visitor = new CreateModelVisitor(); - windowTerm.accept(visitor, first); - } - - /** - * Get element in the model. - * Each model element whose corresponding model query part as a name is added to the result map. - * The element is then accessible with the name set in the query part. - * - * @param query - * @return - * @throws QueryException - */ - public Map queryModel(IQueryExp query) throws QueryException { - - EObject first; - if( query instanceof WindowTerm) { - first = getFirstWindowModel(); - } - else if( query instanceof PanelTerm) { - first = getFirstPanelModel(); - } - else { - throw new QueryException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); - } - - QueryVisitor visitor = new QueryVisitor(); - query.accept(visitor, first); - - return visitor.getResult(); - } - - /** - * Get the model of the first the first window (in actual implementation their is only one window). - * @return - */ - private Window getFirstWindowModel() { - return sashModel.getWindows().get(0); - } - - /** - * Get the panel of the first window (in actual implementation their is only one window). - * @return - */ - private AbstractPanel getFirstPanelModel() { - return sashModel.getWindows().get(0).getPanel(); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQueryTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQueryTest.java deleted file mode 100644 index 7b27fce2b7f..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQueryTest.java +++ /dev/null @@ -1,194 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.folder; -import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.hSash; -import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.page; -import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.vSash; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashWindowsMngr; -import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; -import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.junit.Test; - -/** - * Tests on SashModelQuery. - * Tests for the {@link SashModelQuery} implementation. This is not tests on SashModel - * - * @author dumoulin - * - */ -public class SashModelQueryTest extends AbstractPapyrusTest { - - /** - * Test query structure - */ - @Test - public void testQuery() { - - // Try to create a query - Folder folder = new Folder(new Page(), new Page()); - // Check if well constructed - assertEquals("Contain Two pages", 2, folder.getPages().size()); - - // Check sash - HSash hsash = new HSash(new Folder(new Page()), new Folder(new Page())); - assertNotNull("Folder set", hsash.getLeftup()); - assertNotNull("Folder set", hsash.getRightdown()); - } - - /** - * Test accept visitor. - * - * @throws QueryException - */ - @Test - public void testCreateModelFPP() throws QueryException { - - // Create a modelQuery - SashWindowsMngr diSashModel = DiUtils.createDefaultSashWindowsMngr(); - SashModelQuery modelQuery = new SashModelQuery(diSashModel); - - // Try to create a model - IQueryExp query = new Folder(new Page(), new Page()); - modelQuery.createModel(query); - - // Check creation - modelQuery.assertConform(query); - - // Other query - query = new HSash(new Folder(new Page(), new Page()), new Folder(new Page())); - modelQuery.createModel(query); - - // Check creation - modelQuery.assertConform(query); - - // ********************* - // Other query - query = new HSash(new Folder(new Page(), new Page()), new VSash(new Folder(new Page()), new Folder(new Page()))); - modelQuery.createModel(query); - - // Check creation - modelQuery.assertConform(query); - - - } - - /** - * Test accept visitor. - * - * @throws QueryException - */ - @Test - public void testQueriesWithResult() throws QueryException { - - // Create a modelQuery - SashWindowsMngr diSashModel = DiUtils.createDefaultSashWindowsMngr(); - SashModelQuery modelQuery = new SashModelQuery(diSashModel); - - // Try to create a model - IQueryExp query = new Folder("a", new Page(), new Page()); - modelQuery.createModel(query); - Map result = modelQuery.queryModel(query); - assertNotNull("folder found", result.get("a")); - - // Check creation - modelQuery.assertConform(query); - - // Other query - query = new HSash(new Folder(new Page(), new Page("p1")), new Folder("a", new Page())); - modelQuery.createModel(query); - - // Check creation - modelQuery.assertConform(query); - result = modelQuery.queryModel(query); - assertNotNull("folder found", result.get("a")); - assertTrue("right type", result.get("a") instanceof TabFolder); - assertNotNull("page found", result.get("p1")); - assertTrue("right type", result.get("p1") instanceof PageRef); - - // ********************* - // Other query - query = new HSash(new Folder(new Page(), new Page()), new VSash("s2", new Folder(new Page()), new Folder(new Page()))); - modelQuery.createModel(query); - - // Check creation - modelQuery.assertConform(query); - result = modelQuery.queryModel(query); - assertNotNull("sash found", result.get("s2")); - assertTrue("right type ", result.get("s2") instanceof SashPanel); - - - } - - /** - * Test accept visitor. - * - * @throws QueryException - */ - @Test - public void testStaticCreates() throws QueryException { - - // Create a modelQuery - SashWindowsMngr diSashModel = DiUtils.createDefaultSashWindowsMngr(); - SashModelQuery modelQuery = new SashModelQuery(diSashModel); - - // Try to create a model - IQueryExp query = folder("a", page(), page()); - modelQuery.createModel(query); - // Check creation - modelQuery.assertConform(query); - - // Other query - query = hSash(folder(page(), page("p1")), folder("f1", page())); - modelQuery.createModel(query); - - // Check creation - modelQuery.assertConform(query); - - // ********************* - // Other query - query = hSash(folder(page(), page()), vSash("s2", folder(page()), folder(page()))); - modelQuery.createModel(query); - - // Check creation - modelQuery.assertConform(query); - - } - - /** - * Test toString. - */ - @Test - public void testToString() { - - // Try to create a query - Folder folder = new Folder(new Page(), new Page()); - - assertEquals("String match", "Folder(Page(), Page())", folder.toString()); - - HSash sash = new HSash(folder, new Folder(new Page())); - assertEquals("String match", "HSash(Folder(Page(), Page()), Folder(Page()))", sash.toString()); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/VSash.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/VSash.java deleted file mode 100644 index e1d258fe8f7..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/VSash.java +++ /dev/null @@ -1,87 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; - -/** - * Class for structure representing vertical sash in Checker - * - * @author dumoulin - * - */ -public class VSash extends AbstractSash { - - /** - * Constructor. - * - * @param leftup - * @param rightdown - */ - public VSash(PanelTerm left, PanelTerm right) { - super(left, right); - } - - /** - * Constructor. - * - * @param leftup - * @param rightdown - */ - public VSash(String name, PanelTerm left, PanelTerm right) { - super(name, left, right); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm#accept(IQueryVisitor, EObject) - * - * @param visitor - * @throws QueryException - */ - public void accept(IQueryVisitor visitor, EObject modelObject) throws QueryException { - // Check associated model type - if(! (modelObject instanceof SashPanel) ) { - throw new NoMatchException( "Model object type does not match to SashPanel" ); - } - - SashPanel sashModel = (SashPanel)modelObject; - - // Visit this - if( visitor.isVisitingParentFirst() ) { - visitor.visit(this, sashModel); - } - - // Visit children - leftup.accept(visitor, sashModel.getChildren().get(0)); - rightdown.accept(visitor, sashModel.getChildren().get(1)); - - // Visit this - if( !visitor.isVisitingParentFirst() ) { - visitor.visit(this, sashModel); - } - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.AbstractSash#getStringName() - * - * @return - */ - @Override - protected String getStringName() { - return "VSash"; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/WindowTerm.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/WindowTerm.java deleted file mode 100644 index 7749d26d99a..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/WindowTerm.java +++ /dev/null @@ -1,100 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.core.sashwindows.di.Window; - -/** - * A term representing a Window in the query - * - * @author cedric dumoulin - * - */ -public class WindowTerm implements IQueryTerm { - - /** - * A window have only one panel. - */ - protected PanelTerm panel; - - protected String name; - - /** - * Constructor. - * - * @param panel - */ - public WindowTerm(PanelTerm panel) { - this.panel = panel; - } - - /** - * Constructor. - * - * @param name - * @param panel - */ - public WindowTerm(String name, PanelTerm panel) { - this.name = name; - this.panel = panel; - } - - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm#accept(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor, org.eclipse.emf.ecore.EObject) - * - * @param visitor - * @param panel - * @throws QueryException - */ - public void accept(IQueryVisitor visitor, EObject model) throws QueryException { - - // Check associated model type - if(! (model instanceof Window) ) { - throw new NoMatchException( "Model object type does not match to Window" ); - } - - Window window = (Window)model; - - if( visitor.isVisitingParentFirst() ) { - visitor.visit(this, window); - } - // visit children - panel.accept(visitor, window.getPanel()); - - if( ! visitor.isVisitingParentFirst() ) { - visitor.visit(this, window); - } - - } - - - /** - * @return the panel - */ - public PanelTerm getPanel() { - return panel; - } - - - /** - * @return the name - */ - public String getName() { - return name; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/tests/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/tests/AllTests.java deleted file mode 100644 index efcdccd61b0..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/tests/AllTests.java +++ /dev/null @@ -1,43 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009 CEA LIST & LIFL - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.di.tests; - -import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelMngrTest; -import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.DiContentProvider2Test; -import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.DiContentProviderTest; -import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageManagerImplTest; -import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.TransactionalDiContentProvider2Test; -import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQueryTest; -import org.junit.runner.RunWith; -import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; -import org.junit.runners.Suite.SuiteClasses; - -/** - * Test suite for this fragment - */ -@RunWith(ClassificationSuite.class) -@SuiteClasses({ - // package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider - DiSashModelMngrTest.class, - // package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal - DiContentProviderTest.class, - DiContentProvider2Test.class, - TransactionalDiContentProvider2Test.class, - PageManagerImplTest.class, - // package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query - SashModelQueryTest.class -}) -public class AllTests { - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.classpath b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.classpath deleted file mode 100644 index 046bda900d2..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.project b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.project deleted file mode 100644 index 13ca6a9419b..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.infra.core.sasheditor.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/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 4759947300a..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.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.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 -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/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.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/core/org.eclipse.papyrus.infra.core.sasheditor.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/META-INF/MANIFEST.MF deleted file mode 100644 index ff298d7c6f3..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,31 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui.editors;bundle-version="3.8.0", - org.eclipse.jface.text;bundle-version="3.8.0", - org.eclipse.ui.ide;bundle-version="3.8.0", - org.eclipse.core.resources;bundle-version="3.8.0", - org.junit;bundle-version="4.10.0", - org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.2.0", - org.eclipse.ui;bundle-version="3.106.0", - org.eclipse.ui.workbench.texteditor;bundle-version="3.9.0", - org.eclipse.core.runtime;bundle-version="3.10.0", - org.eclipse.emf.ecore;bundle-version="2.11.0", - org.eclipse.papyrus.junit.framework;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.2.0" -Export-Package: org.eclipse.papyrus.infra.core.sasheditor.contentprovider, - org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple, - org.eclipse.papyrus.infra.core.sasheditor.editor, - org.eclipse.papyrus.infra.core.sasheditor.internal, - org.eclipse.papyrus.infra.core.sasheditor.pagesmodel, - org.eclipse.papyrus.infra.core.sasheditor.tests, - org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor, - org.eclipse.papyrus.infra.core.sasheditor.tests.utils, - org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak, - org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace, - org.eclipse.papyrus.infra.core.sasheditor.utils -Bundle-Vendor: %providerName -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.infra.core.sasheditor.tests;singleton:=true -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/about.html b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.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/core/org.eclipse.papyrus.infra.core.sasheditor.tests/build.properties b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/build.properties deleted file mode 100644 index 4cedaeae848..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -source.. = test/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - org.eclipse.papyrus.infra.core.sasheditor.tests.launch,\ - plugin.properties,\ - about.html,\ - plugin.xml diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/org.eclipse.papyrus.infra.core.sasheditor.tests.launch b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/org.eclipse.papyrus.infra.core.sasheditor.tests.launch deleted file mode 100644 index 8bb91f42500..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/org.eclipse.papyrus.infra.core.sasheditor.tests.launch +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.properties b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.properties deleted file mode 100644 index 195f10e33bb..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.properties +++ /dev/null @@ -1,13 +0,0 @@ -################################################################################# -# Copyright (c) 2010 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=Papyrus Sash editor Tests Fragment -providerName=Eclipse Modeling Project - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.xml b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.xml deleted file mode 100644 index 882b613cbe1..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/pom.xml b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/pom.xml deleted file mode 100644 index 7f80786cb12..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.tests.releng - 1.2.0-SNAPSHOT - ../../../../../releng/main-tests - - org.eclipse.papyrus - org.eclipse.papyrus.infra.core.sasheditor.tests - 1.2.0-SNAPSHOT - eclipse-test-plugin - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/AbstractSashWindowContentProviderFacadeTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/AbstractSashWindowContentProviderFacadeTest.java deleted file mode 100644 index 4f75964c4e1..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/AbstractSashWindowContentProviderFacadeTest.java +++ /dev/null @@ -1,272 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider; - -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.folder; -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.page; -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.vSash; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; -import org.eclipse.swt.SWT; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - - -/** - * Test suite for {@link ISashWindowsContentProviderFacade} implementations. - * Each implementation of {@link ISashWindowsContentProviderFacade} can be tested with this suite. - * This class provides the tests common to all implementation. - * - * An implementation can be tested by subclassing this class, and by implementing the - * getIcontentProviderFacade method. This later should return the implementation of - * {@link ISashWindowsContentProviderFacade} to test. - * - * @author cedric dumoulin - * - */ -public abstract class AbstractSashWindowContentProviderFacadeTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - /** - * Create an instance of the {@link ISashWindowsContentProviderFacade} to test. - * - * @return an instance of {@link ISashWindowsContentProviderFacade}; - */ - abstract public ISashWindowsContentProviderFacade createISashWindowsContentProviderFacade(); - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#assertConform(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. - * @throws PagesModelException - */ - @Test - public void testAssertConform() throws PagesModelException { - ISashWindowsContentProviderFacade helper = createISashWindowsContentProviderFacade(); - - assertNotNull("helper created", helper); - // Create a query - IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); - // Try to create the model - helper.createModel(expr); - - // Try to check model - helper.assertConform(expr); - - } - - /** - * Test assertConform with expr starting with a folder. - * @throws PagesModelException - */ - @Test - public void testAssertConformExprStartngWithFolder() throws PagesModelException { - ISashWindowsContentProviderFacade helper = createISashWindowsContentProviderFacade(); - - assertNotNull("helper created", helper); - // Create a query - IModelExp expr = folder( "f1", page("p1"), page("p2"), page("p3"), page("p4"), - page("p5"), page("p6"), page("p7"), page("p8")); - // Try to create the model - helper.createModel(expr); - - - // Check if conform - helper.assertConform(expr); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#createModel(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. - * @throws PagesModelException - */ - @Test - public void testCreateModel() throws PagesModelException { - ISashWindowsContentProviderFacade helper = createISashWindowsContentProviderFacade(); - - assertNotNull("helper created", helper); - // Create a query - IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); - // Try to create the model - helper.createModel(expr); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#queryModel(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. - * @throws PagesModelException - */ - @Test - public void testQueryModel() throws PagesModelException { - ISashWindowsContentProviderFacade helper = createISashWindowsContentProviderFacade(); - - assertNotNull("helper created", helper); - // Create a query - IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); - // Try to create the model - helper.createModel(expr); - - // Query model - Map res = helper.queryModel(expr); - assertNotNull("found f1", res.get("f1")); -// assertTrue("right type", res.get("f1") instanceof TabFolderModel ); - - assertNotNull("found f2", res.get("f2")); -// assertTrue("right type", res.get("f2") instanceof TabFolderModel ); - - assertNotNull("found p2", res.get("p2")); -// assertTrue("right type", res.get("p2") instanceof IPageModel ); - } - - /** - * Test folder creation. - * Use the pagemodels utilities {@link SimpleSashWindowContentProviderUtils}. - * @throws PagesModelException - */ - @Test - public void testCreateFolder() throws PagesModelException { - - - ISashWindowsContentProviderFacade contentFacade = createISashWindowsContentProviderFacade(); - - assertNotNull("helper created", contentFacade); - // Create a query -// IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); - IModelExp expr = folder( "f1", page("p1"), page("p2"), page("p3"), page("p4"), - page("p5"), page("p6"), page("p7"), page("p8")); - // Try to create the model - contentFacade.createModel(expr); - - // Create another folder - contentFacade.createFolder("f1", 0, "f1", SWT.UP); - // Check the content configuration - IModelExp conf1Expr = vSash( - folder( "f2", page("p1") ), - folder( "f1", page("p2"), page("p3"), page("p4"), - page("p5"), page("p6"), page("p7"), page("p8") ) - ); - // Check if conform - contentFacade.assertConform(conf1Expr); - - // Check resetContext - contentFacade.resetNamesContext(conf1Expr); - - assertNotNull("new name found", contentFacade.getNamesToInternalMap().get("f2")); - } - - - /** - * Test page creation. - * @throws PagesModelException - */ - @Test - public void testCreateNewPage() throws PagesModelException { - ISashWindowsContentProviderFacade helper = createISashWindowsContentProviderFacade(); - - assertNotNull("helper created", helper); - // Create a query - IModelExp expr = folder( "f1", page("p1"), page("p2"), page("p3"), page("p4"), - page("p5"), page("p6"), page("p7"), page("p8")); - // Try to create the model - helper.createModel(expr); - - // Create a new page - helper.addPage(page("newPage"), "f1"); - - // Check the content configuration - IModelExp conf1Expr = folder( "f1", page("p1"), page("p2"), page("p3"), page("p4"), - page("p5"), page("p6"), page("p7"), page("p8"), page("newPage")); - - // Check if conform - helper.assertConform(conf1Expr); - - } - - /** - * Test page deletion. - * @throws PagesModelException - */ - @Test - public void testClosePage() throws PagesModelException { - ISashWindowsContentProviderFacade helper = createISashWindowsContentProviderFacade(); - - assertNotNull("helper created", helper); - // Create a query - IModelExp expr = folder( "f1", page("p1"), page("p2"), page("p3"), page("p4"), - page("p5"), page("p6"), page("p7"), page("p8")); - // Try to create the model - helper.createModel(expr); - - // Create a new page - helper.removePage( "p8"); - - // Check the content configuration - IModelExp conf1Expr = folder( "f1", page("p1"), page("p2"), page("p3"), page("p4"), - page("p5"), page("p6"), page("p7")); - - // Check if conform - helper.assertConform(conf1Expr); - - } - - /** - * Test folder deletion. - * Use the pagemodels utilities {@link SimpleSashWindowContentProviderUtils}. - * @throws PagesModelException - */ - @Test - public void testDeleteFolder() throws PagesModelException { - - - ISashWindowsContentProviderFacade contentFacade = createISashWindowsContentProviderFacade(); - - assertNotNull("helper created", contentFacade); - // Create a query -// IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); - IModelExp expr = vSash( - folder( "f1", page("p2"), page("p3"), page("p4") ), - folder( "f2", page("p1") ) - ); - // Try to create the model - contentFacade.createModel(expr); - - // Create the folder. - // This is done by closing the last page - contentFacade.removePage("p1"); - - // Check the content configuration - IModelExp conf1Expr = folder( "f1", page("p2"), page("p3"), page("p4")); - // Check if conform - contentFacade.assertConform(conf1Expr); - - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/IPageMngrTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/IPageMngrTest.java deleted file mode 100644 index b4dab94ba55..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/IPageMngrTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider; - -import junit.framework.TestCase; - -import org.junit.After; -import org.junit.Before; - - -/** - * Base class for testing real implementation of ContentProvider. - * Real implementation should subclass this class, and implement the create method. - * - * @author cedric dumoulin - * - */ -public abstract class IPageMngrTest extends TestCase { - - /** - * The public API allowing to access to the implementation. - */ - protected ISashWindowsContentProvider contentProvider; - - /** - * The public API allowing to access to the implementation. - */ - // protected IPageMngr pageMngr; - - /** - * Setup the test. - * - * @see junit.framework.TestCase#setUp() - * - * @throws Exception - */ - @Before - @Override - protected void setUp() throws Exception { - // TODO Auto-generated method stub - super.setUp(); - } - - @After - @Override - protected void tearDown() throws Exception { - // TODO Auto-generated method stub - super.tearDown(); - } - - /** - * Test that the pageIdentifier passed to addPAge() is provided back from {@link ISashWindowsContainer#getActiveEditor()()} - */ - public void testAddPage() { - - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/ISashWindowsContentProviderFacade.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/ISashWindowsContentProviderFacade.java deleted file mode 100644 index 46c057284e4..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/ISashWindowsContentProviderFacade.java +++ /dev/null @@ -1,220 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider; - -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IAbstractPanelModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NotFoundException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; - - -/** - * Interface providing a common facade to test the {@link ISashWindowsContentProvider} implementations. - *
- * This facade provides methods to manipulate {@link ISashWindowsContentProvider} with - * the help of names. Each element in the {@link SimpleSashWindowsContentProvider} can be identified - * by a name (String). Then, the facade provide methods similar to {@link ISashWindowsContentProvider}, but using - * names rather than {@link IAbstractPanelModel} and {@link ITabFolderModel}. - *
- * The facade maintains a mapping between the names and the {@link ISashWindowsContentProvider} models. - - *
- * Implementations of this class - * allow to create an internal model according to a provided {@link IModelExp}. It is also possible - * to check if the internal model is conform to the {@link IModelExp}. - * - *
- * There is several {@link ISashWindowsContentProvider} implementations, but a lot of tests are commons to - * all the implementations. The interface allows to develop common tests regardless of the real implementation. - *
- * One develop common tests using {@link ISashWindowsContentProvider} and {@link ISashWindowsContentProviderFacade}. Then, - * this test is subclassed and the appropriate implementations are specified in the subclasses. - * - * - * @author cedric dumoulin - * - */ -public interface ISashWindowsContentProviderFacade { - - /** - * Create an internal model conform to the specified query. - * Any previous model is disguarded. - * - * Some implementations do not allow to call this method more than once. In this case, - * the implementation should throw an Exception. - * - * @param query Should be a subtype PanelTerm (Folder, HSash, VSash) - * @throws QueryException - * - */ - public abstract void createModel(IModelExp query) throws PagesModelException; - - /** - * Check if the internal model is conformed to the specified query. - * @param query - * @throws QueryException - */ - public abstract void assertConform(IModelExp query) throws PagesModelException; - - /** - * Get element in the model. - * Each model element whose corresponding model query part as a name is added to the result map. - * The element is then accessible with the name set in the query part. - * - * @param query - * @return - * @throws QueryException - */ - public abstract Map queryModel(IModelExp query) throws PagesModelException; - - /** - * Get the {@link ISashWindowsContentProvider} associated to this utility class. - * @return - */ - public ISashWindowsContentProvider getIContentProvider(); - - /** - * Add a page at the specified index of TabFolder. - *
- * This method is not used by the {@link ISashWindowsContainer}. - * - * @param page - * An object identifying the page to add. The object could be anything. It will be - * passed to the {@link ITabFolderModel#createChildSashModel(Object)} method. - * @param index - * Index to where the tabItem should be added. - * @throws NotFoundException - */ - public void /*IPageModel*/ addPage(Page page, String folderName, int index) throws PagesModelException; - - /** - * Add a page at the end of TabFolder. - *
- * This method is not used by the {@link ISashWindowsContainer}. - * - * @param page - * An object identifying the page to add. The object could be anything. It will be - * passed to the {@link ITabFolderModel#createChildSashModel(Object)} method. - * @return - * @throws NotFoundException - */ - public void /*IPageModel*/ addPage(Page page, String folderName) throws PagesModelException; - - /** - * Move a tab inside the specified folder. - * - * @param model - * @param oldIndex - * @param newIndex - * @throws NotFoundException - */ - public void movePage(String folderName, int oldIndex, int newIndex) throws NotFoundException; - - /** - * Move a tab from folder to folder. - * - * @param model - * @param sourceIndex - * @param model2 - * @param targetIndex - */ - public void movePage(String srcFolderName, int sourceIndex, String targetFolderName, int targetIndex) throws NotFoundException; - - /** - * Remove the page from the sashes window. - * Look for the folder containing the page. - * - * @param page - * The Object identifying the page. This is the object used in {@link #addPage(Object)}. - */ - public void removePage(String pageName) throws NotFoundException; - - /** - * Remove the specified page from the parentFolder. - * - * @param tabItem - */ - public void removePage(String folderName, int tabIndex) throws NotFoundException; - - /** - * Ask the model to move the specified tab to the specified side of the specified targetFolder. - * This method - * is called by the the SashTileContainer when the user - * have drag a tab in a correct place. The SashTileContainer has not change is presentation yet. This - * will be done when the corresponding event will occur. - * - * @param tabFolder - * The folder containing the tab to move - * @param tabIndex - * The index of the tab to move - * @param targetFolder - * The folder to which the side refer to - * @param side - * Side where node should be inserted : SWT.LEFT, SWT.RIGHT, SWT.TOP, SWT.DOWN. - * @throws PagesModelException - */ - public void createFolder(String tabFolder, int tabIndex, String targetFolder, int side) throws PagesModelException; - - /** - * - * Reset the namesMapping context accordingly to the provided expr. - * The names mapping is used to lookup Model element by there name. - * The name mapping should be reset when the internal structure has change, - * and especially when an element is added. - *
- * Reseting the names context allows to remove or add names to the context. - * It is used to add names of newly created elements (created with addPage() or createFolder() ) - - * @param expr - * @throws PagesModelException - */ - public void resetNamesContext(IModelExp expr) throws PagesModelException; - - /** - * A facade is associated to a names and internal models map that is internally used - * to lookup elements. - * This maps is reset with {@link #resetNamesContext(IModelExp)} - * @return The names to internal maps. - */ - public Map getNamesToInternalMap(); - - /** - * Ask the model to move the specified tab to the specified side of the specified targetFolder. - * This method - * is called by the the SashTileContainer when the user - * have drag a tab in a correct place. The SashTileContainer has not change is presentation yet. This - * will be done when the corresponding event will occur. - * - * @param tabFolder - * The folder containing the tab to move - * @param tabIndex - * The index of the tab to move - * @param targetFolder - * The folder to which the side refer to - * @param side - * Side where node should be inserted : SWT.LEFT, SWT.RIGHT, SWT.TOP, SWT.DOWN. - * @throws PagesModelException - */ -// public void createFolder(String newFolderName, String tabFolder, int tabIndex, String targetFolder, int side) throws PagesModelException; - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/AllTests.java deleted file mode 100644 index 33e6b522ff6..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/AllTests.java +++ /dev/null @@ -1,26 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010 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 - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; - -import org.junit.runner.RunWith; -import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; -import org.junit.runners.Suite.SuiteClasses; - - -/** - * All tests for package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple - */ -@RunWith(ClassificationSuite.class) -@SuiteClasses({ SimpleSashWindowsContentProviderTest.class }) -public class AllTests { - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CheckVisitor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CheckVisitor.java deleted file mode 100644 index 1c33b4ae10d..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CheckVisitor.java +++ /dev/null @@ -1,109 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NoMatchException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; - - -/** - * @author cedric dumoulin - * - */ -public class CheckVisitor extends SimpleContentProviderBaseVisitor implements IPagesModelVisitor { - - /** - * @return the isVisitingParentFirst - */ - @Override - public boolean isVisitingParentFirst() { - return false; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) - * - * @param windowTerm - * @param windowModel - */ - @Override - public void visit(WindowTerm windowTerm, RootModel windowModel) { - // TODO Auto-generated method stub - - } - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder) - * - * @param folder - */ - @Override - public void visit(Folder folder, TabFolderModel folderModel) { - // Check name - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash) - * - * @param sash - */ - @Override - public void visit(HSash sash, SashPanelModel sashModel) { - // TODO Auto-generated method stub - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash) - * - * @param sash - */ - @Override - public void visit(VSash sash , SashPanelModel sashModel) { - // TODO Auto-generated method stub - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page) - * - * @param page - * @throws NoMatchException - */ - @Override - public void visit(Page page, IPageModel pageModel) throws PagesModelException { - //check name - if(page.getIdentifier() != null) { - checkName(page.getIdentifier(), pageModel.getTabTitle()) ; - } - else if(page.getName() != null) { - checkName(page.getName(), pageModel.getTabTitle()) ; - } - } - - - protected void checkName( Object expectedName, Object foundName) throws NoMatchException { - if( expectedName != foundName ) - throw new NoMatchException( "Names do not match (expected=" - + expectedName + ", found="+ foundName ); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CreateModelInSimpleContentProviderVisitor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CreateModelInSimpleContentProviderVisitor.java deleted file mode 100644 index 1987f1b0322..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CreateModelInSimpleContentProviderVisitor.java +++ /dev/null @@ -1,157 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.AbstractPanelModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SashPanelModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.TabFolderModel; -import org.eclipse.papyrus.infra.core.sasheditor.editor.MessagePartModel; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PanelTerm; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; -import org.eclipse.swt.SWT; - -/** - * This visitor is used with {@link IModelExp} to create a pages model in a {@link SimpleContentProvider} instancied - * with the Sash, folders and pages specified in the expr. - * - * - * @author cedric dumoulin - * - */ -public class CreateModelInSimpleContentProviderVisitor extends SimpleContentProviderBaseVisitor implements IPagesModelVisitor { - - /** - * {@link SimpleSashWindowsContentProvider} into which model is created. - */ - private SimpleSashWindowsContentProvider contentProvider; - - /** - * Constructor. - * - * @param contentProvider - */ - public CreateModelInSimpleContentProviderVisitor(SimpleSashWindowsContentProvider contentProvider) { - this.contentProvider = contentProvider; - } - - /** - * @return the isVisitingParentFirst - */ - public boolean isVisitingParentFirst() { - return true; - } - - /** - * There is no windowTerm counterpart in {@link SimpleSashWindowsContentProvider}. - * @param windowTerm - * @param windowModel - */ - @Override - public void visit(WindowTerm windowTerm, RootModel windowModel) { - // Create children of the window - PanelTerm panel = windowTerm.getPanel(); - - AbstractPanelModel childPanel = createPanelOrFolder(panel, windowModel); - windowModel.replaceChild(windowModel.getChild(), childPanel); - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder, org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder) - * - * @param folder - * @param folderModel - */ - @Override - public void visit(Folder folder, TabFolderModel folderModel) { - - // Create children of the folder - for( Page page : folder.getPages() ) { - // Create a page of type "MessagePartModel". - folderModel.getChildren().add( new MessagePartModel( page.getName(), page.getName() )); - } - - } - - /** - * - * @param sashQuery - * @param sashModel - */ - public void visit(HSash sashQuery, SashPanelModel sashModel) { - - // Create children of the sash - AbstractPanelModel leftChild = createPanelOrFolder(sashQuery.getLeftup(), sashModel); - sashModel.setLeftChild( leftChild ) ; - AbstractPanelModel rightChild = createPanelOrFolder(sashQuery.getRightdown(), sashModel); - sashModel.setRightChild(rightChild); - } - - /** - * @param sashModel - * @param panel - */ - private AbstractPanelModel createPanelOrFolder(PanelTerm panel, AbstractModel parent ) { - if(panel instanceof HSash) { - // Create a sash with null children. - // This is not a good example of how to proceed. Avoid to use it like this. - // Here we can do this because we know that we create the children soon. - return new SashPanelModel(parent, null, null, SWT.HORIZONTAL); - } - else if(panel instanceof VSash) { - return new SashPanelModel(parent, null, null, SWT.VERTICAL); - } - else /*if (panel instanceof Folder)*/ { - TabFolderModel folder = new TabFolderModel(contentProvider); - folder.setParent(parent); - return folder; - } - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) - * - * @param sash - * @param sashModel - */ - public void visit(VSash sashQuery, SashPanelModel sashModel) { - // Create children of the sash - AbstractPanelModel leftChild = createPanelOrFolder(sashQuery.getLeftup(), sashModel); - sashModel.setLeftChild( leftChild ) ; - AbstractPanelModel rightChild = createPanelOrFolder(sashQuery.getRightdown(), sashModel); - sashModel.setRightChild(rightChild); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page, org.eclipse.papyrus.infra.core.sashwindows.di.PageRef) - * - * @param page - * @param pageModel - */ - public void visit(Page page, IPageModel pageModel) { - // Page is created and identifier already set. - // Nothing to do - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/FakePageModel.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/FakePageModel.java deleted file mode 100644 index 095f6774e71..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/FakePageModel.java +++ /dev/null @@ -1,69 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009, 2014 LIFL, 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: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * Christian W. Damus (CEA) - bug 392301 - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.swt.graphics.Image; - - -/** - * A fake page for testing purpose - * - * @author dumoulin - */ -public class FakePageModel implements IPageModel { - - String title; - - static int count = 0; - - public FakePageModel() { - title = "noname" + count++; - } - - /** - * @param title - */ - public FakePageModel(String title) { - this.title = title; - } - - /** - * {@inheritDoc} - */ - public Object getRawModel() { - return this; - } - - /** - * {@inheritDoc} - */ - public Image getTabIcon() { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public String getTabTitle() { - // TODO Auto-generated method stub - return null; - } - - public void dispose() { - // Pass - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/QueryVisitor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/QueryVisitor.java deleted file mode 100644 index a44ba367f40..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/QueryVisitor.java +++ /dev/null @@ -1,134 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelObject; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; - -/** - * Visitor used to collect element in the model. - * Each element in the model associated with a{@link IQueryTerm} whose name is set is collectted. - * The collected element is then accessible from the result map, using the name set in the IQueryTerm. - * - * - * @author cedric dumoulin - * - */ -public class QueryVisitor extends SimpleContentProviderBaseVisitor implements IPagesModelVisitor { - - /** - * The result map. - */ - protected Mapresult = new HashMap(); - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) - * - * @param windowTerm - * @param windowModel - */ - @Override - public void visit(WindowTerm windowTerm, RootModel windowModel) { - collect( windowTerm, windowModel); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder, org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder) - * - * @param folder - * @param folderModel - */ - @Override - public void visit(Folder folder, TabFolderModel folderModel) { - collect(folder, folderModel); - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) - * - * @param sash - * @param sashModel - */ - @Override - public void visit(HSash sash, SashPanelModel sashModel) { - collect(sash, sashModel); - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) - * - * @param sash - * @param sashModel - */ - @Override - public void visit(VSash sash, SashPanelModel sashModel) { - collect(sash, sashModel); - - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page, org.eclipse.papyrus.infra.core.sashwindows.di.PageRef) - * - * @param page - * @param pageModel - */ - @Override - public void visit(Page page, IPageModel pageModel) { - collect(page, pageModel); - - } - - /** - * Add the element associated to the query to the result, if the query has a name. - * @param iQueryTerm - * @param element - */ - protected void collect( IModelObject iQueryTerm, Object element) { - - if( iQueryTerm.getName() == null) { - return; - } - - result.put(iQueryTerm.getName(), element); - } - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#isVisitingParentFirst() - * - * @return - */ - @Override - public boolean isVisitingParentFirst() { - return true; - } - - /** - * @return the result - */ - public Map getResult() { - return result; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleContentProviderBaseVisitor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleContentProviderBaseVisitor.java deleted file mode 100644 index d84f0399f0d..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleContentProviderBaseVisitor.java +++ /dev/null @@ -1,316 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; - -import java.util.Iterator; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.AbstractPanelModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.RootModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SashPanelModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.TabFolderModel; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NoMatchException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModel; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; -import org.eclipse.swt.SWT; - -/** - * A base implementation of {@link IPagesModelVisitor} to visit conjointly SashPagesModel and - * SimpleContentProvider. - * - * This implementation separate the navigation part (walk(term, contentProviderModel)) and - * the visit part (visit(term, contentProviderModel)). It implements the navigation part. - *
- * The visit part should be implemented by subclasses. - * - * - * - * @author cedric dumoulin - * - */ -public class SimpleContentProviderBaseVisitor implements IPagesModelVisitor { - - /** - * @return the isVisitingParentFirst - */ - public boolean isVisitingParentFirst() { - return true; - } - - /** - * Visit the model. Actually, there is no counterpart for {@link SashPagesModel} in {@link SimpleContentProvider}. - * - * @param windowTerm - * @param windowModel - * @throws PagesModelException - */ - public void walk(SashPagesModel pagesModel, Object contentProviderModel) throws PagesModelException { - // Check associated model type - if(! (contentProviderModel instanceof SimpleSashWindowsContentProvider) ) { - throw new NoMatchException( "ContentProvider type ("+ contentProviderModel.getClass().getName()+ ") does not match to WindowTerm" ); - } - - SimpleSashWindowsContentProvider contentProvider = (SimpleSashWindowsContentProvider)contentProviderModel; - - if( isVisitingParentFirst() ) { - visit(pagesModel, contentProvider); - } - // visit children - for( WindowTerm windowTerm : pagesModel.getWindows() ) { - // Only one window - RootModel windowModel = (RootModel) ((AbstractPanelModel)contentProvider.getRootModel()).getParent(); - windowTerm.getPanel().accept(this, windowModel); - } - if( ! isVisitingParentFirst() ) { - visit(pagesModel, contentProvider); - } - } - - /** - * Walk the WindowTerm and its child. - * @param windowTerm - * @param windowModel - * @throws PagesModelException - */ - public void walk(WindowTerm windowTerm, Object windowModel) throws PagesModelException { - // Check associated model type - if(! (windowModel instanceof RootModel) ) { - throw new NoMatchException( "ContentProvider type ("+ windowModel.getClass().getName()+ ") does not match to WindowTerm" ); - } - - RootModel window = (RootModel)windowModel; - - if( isVisitingParentFirst() ) { - visit(windowTerm, window); - } - // visit children - windowTerm.getPanel().accept(this, window.getChild()); - - if( ! isVisitingParentFirst() ) { - visit(windowTerm, window); - } - } - - /** - * Walk folder and its children. - * - * @param folder - * @param folderModel - * @throws PagesModelException - */ - public void walk(Folder folder, Object model) throws PagesModelException { - // Check associated model type - if(! (model instanceof TabFolderModel) ) { - throw new NoMatchException( this.toString() - + "\n" + folder - + "\n - Model object type does not match to FolderQueryPart." - + " Expected TabFolderModel, found '" + model.getClass().getSimpleName() + "'." - + " (" + folder.getName() +")" ); - } - TabFolderModel folderModel = (TabFolderModel)model; - - // Visit this - if( isVisitingParentFirst() ) { - visit(folder, folderModel); - } - - // visit children - Iterator pageRefs = folderModel.getChildren().iterator(); - Iterator pageQueries = folder.getPages().iterator(); - while (pageRefs.hasNext() && pageQueries.hasNext() ) { - IPageModel pageRef = pageRefs.next(); - Page query = pageQueries.next(); - - query.accept(this, pageRef); - } - if (pageRefs.hasNext()) { - // some page left - throw new NoMatchException( "Folder matching - " - + this.toString() - +" folder model have more pages than folder query. ("+folder.getName()+")" ); - } else if (pageQueries.hasNext() ) { - // some queries left - throw new NoMatchException( "Folder matching - " - + this.toString() - +" folder query have more page than folder model. ("+folder.getName()+")" ); - } - // Visit this - if( ! isVisitingParentFirst() ) { - visit(folder, folderModel); - } - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor#walk(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash, java.lang.Object) - * - * @param sash - * @param sashModel - * @throws PagesModelException - */ - public void walk(HSash sash, Object model) throws PagesModelException { - // Check associated model type - if(! (model instanceof SashPanelModel) ) { - throw new NoMatchException( this.toString() + " - Model object type does not match to SashPanel (found " - + model.getClass() - + " )"); - } - - SashPanelModel sashModel = (SashPanelModel)model; - - // Check orientation - if( sashModel.getSashDirection() != SWT.HORIZONTAL) { - throw new NoMatchException( this.toString() + " - SashOrientation does not match 'HORIZONTAL'" ); - } - // Visit this - if( isVisitingParentFirst() ) { - visit(sash, sashModel); - } - - // Visit children - sash.getLeftup().accept(this, sashModel.getChildren().get(0)); - sash.getRightdown().accept(this, sashModel.getChildren().get(1)); - - if( !isVisitingParentFirst() ) { - visit(sash, sashModel); - } - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor#walk(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash, java.lang.Object) - * - * @param sash - * @param sashModel - * @throws PagesModelException - */ - public void walk(VSash sash, Object model) throws PagesModelException { - // Check associated model type - if(! (model instanceof SashPanelModel) ) { - throw new NoMatchException( this.toString() + " - Model object type does not match to SashPanel (found " - + model.getClass() - + " )"); - } - - SashPanelModel sashModel = (SashPanelModel)model; - - // Check orientation - if( sashModel.getSashDirection() != SWT.VERTICAL) { - throw new NoMatchException( this.toString() + " - SashOrientation does not match 'VERTICAL'" ); - } - // Visit this - if( isVisitingParentFirst() ) { - visit(sash, sashModel); - } - - // Visit children - sash.getLeftup().accept(this, sashModel.getChildren().get(0)); - sash.getRightdown().accept(this, sashModel.getChildren().get(1)); - - if( !isVisitingParentFirst() ) { - visit(sash, sashModel); - } - } - - /** - * Walk the page. Simply call the corresponding {@link SimpleContentProviderBaseVisitor#visit(Page, IPageModel)} method. - * @param page - * @param pageModel - * @throws PagesModelException - */ - public void walk(Page page, Object model) throws PagesModelException { - // Check associated model type - if(! (model instanceof IPageModel) ) { - throw new NoMatchException( this.toString() + " - Model object type does not match to PageRef" ); - } - IPageModel pageModel = (IPageModel)model; - visit(page, pageModel); - } - - - /** - * Visit the model. Actually, there is no counterpart for {@link SashPagesModel} in {@link SimpleContentProvider}. - * - * @param windowTerm - * @param windowModel - * @throws PagesModelException - */ - public void visit(SashPagesModel pagesModel, Object windowModel) throws PagesModelException { - - } - - /** - * Visit the corresponding node. - * To be implemented by subclass. - * - * - * @param windowTerm - * @param windowModel - */ - public void visit(WindowTerm windowTerm, RootModel windowModel) throws PagesModelException { - // To be implemented by subclass. - } - - /** - * Visit the corresponding node. - * To be implemented by subclass. - * - * @param folder - * @param folderModel - */ - public void visit(Folder folder, TabFolderModel folderModel) throws PagesModelException{ - - } - - /** - * Visit the corresponding node. - * To be implemented by subclass. - * - * @param sashQuery - * @param sashModel - */ - public void visit(HSash sashQuery, SashPanelModel sashModel) throws PagesModelException { - - } - - /** - * Visit the corresponding node. - * To be implemented by subclass. - * - * - * @param sash - * @param sashModel - */ - public void visit(VSash sashQuery, SashPanelModel sashModel) throws PagesModelException{ - } - - /** - * Visit the corresponding node. - * To be implemented by subclass. - * - * - * @param page - * @param pageModel - */ - public void visit(Page page, IPageModel pageModel) throws PagesModelException { - - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacade.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacade.java deleted file mode 100644 index 5f6fcdf1fcf..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacade.java +++ /dev/null @@ -1,452 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; - -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IAbstractPanelModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; -import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer; -import org.eclipse.papyrus.infra.core.sasheditor.editor.MessagePartModel; -import org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.BadNameException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NotFoundException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PanelTerm; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * Class providing a facade to test the {@link SashWindowsContainer} class. - *
- * This facade own a {@link SimpleSashWindowsContentProvider}, a {@link SashWindowsContainer} and - * provides methods to manipulate it with the help of names. - *
- * The facade allows to create pages and folders in the sashContainer, thru the ContentProvider. - * It also allows to check the resulting structure inside the SashContainer. - * The facade can also be used to create a particular configuration of the SashContainer, and apply - * tests on this configuration. - *
- * Each element in the {@link SimpleSashWindowsContentProvider} can be identified - * by a name (String). Then, the facade provide methods similar to {@link ISashWindowsContentProvider}, but using - * names rather than {@link IAbstractPanelModel} and {@link ITabFolderModel}. - *
- * The facade maintains a mapping between the names and the {@link ISashWindowsContentProvider} models. - *
- * The - * @author cedric dumoulin - * - */ -public class SimpleSashWindowContainerTestFacade implements ISashWindowsContentProviderFacade { - - /** - * The internal content provider this facade is for. - */ - protected SimpleSashWindowsContentProvider contentProvider; - - /** - * The associated SashContainer - */ - protected SashWindowsContainer sashContainer; - /** - * Display used to create windows. - */ - protected Display display; - - - /** - * Mapping between names provided in the expressions and internal implementations of the {@link SimpleSashWindowsContentProvider}. - * This mapping is maintained when elements are added or removed. - * - */ - protected Map namesMapping; - - /** - * Constructor. - * Create a default internal {@link SimpleSashWindowsContentProvider}; - * @param modelMngr - */ - public SimpleSashWindowContainerTestFacade() { - this.contentProvider = new SimpleSashWindowsContentProvider(); - initDisplay(); - sashContainer = createSashWindowsContainer(contentProvider); - } - - /** - * Constructor. - * - * @param modelMngr - */ - public SimpleSashWindowContainerTestFacade(SimpleSashWindowsContentProvider contentProvider) { - this.contentProvider = contentProvider; - initDisplay(); - sashContainer = createSashWindowsContainer(contentProvider); - } - - /** - * Init the display object. - */ - protected void initDisplay() { - display = Display.getCurrent(); - if(display == null) { - display = new Display(); - } - } - /** - * Create a {@link SashWindowsContainer} to test. Initialize it with provided {@link ISashWindowsContentProvider}. - * - * @param contentProvider - * @return - */ - protected SashWindowsContainer createSashWindowsContainer(ISashWindowsContentProvider contentProvider) { - Shell shell = new Shell(display); - shell.setLayout(new FillLayout()); - - // - //new ShellEditor(shell); - SashWindowsContainer sashWindowContainer = new SashWindowsContainer(); - - sashWindowContainer.setContentProvider(contentProvider); - - sashWindowContainer.createPartControl(shell); - // shell.open(); - return sashWindowContainer; - } - - - /** - * @return the sashContainer - */ - public SashWindowsContainer getSashContainer() { - return sashContainer; - } - - /** - * @return the ISashWindowsContainer interface - */ - public ISashWindowsContainer getISashWindowsContainer() { - return sashContainer; - } - - /** - * @return the contentProvider - */ - public ISashWindowsContentProvider getIContentProvider() { - return contentProvider; - } - - /** - * Dispose the facade - */ - public void dispose() { - sashContainer.dispose(); - // display.dispose(); - if(namesMapping != null) { - namesMapping.clear(); - } - contentProvider = null; - sashContainer = null; - } - - /** - * Reset the namesMapping context accordingly to the provided expr. - * A side effect is that the internal structure is checked against the expr. - *
- * Reseting the names context allows to remove or add names to the context. - * It is used to add names of newly created elements (created with addPage() or createFolder() ) - - * @param expr - * @throws PagesModelException - */ - public void resetNamesContext(IModelExp expr) throws PagesModelException { - namesMapping = queryModel(expr); - } - - /** - * Check if the internal {@link ISashWindowsContentProvider} is conformed to the specified expression. - * @param expr - * @throws QueryException - */ - public void assertConform(IModelExp expr) throws PagesModelException { - - Object first; - if( expr instanceof WindowTerm) { - first = getFirstWindowModel(); - } - else if( expr instanceof PanelTerm) { - first = getFirstPanelModel(); - } - else { - throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + expr.toString() + ")"); - } - - CheckVisitor visitor = new CheckVisitor(); - expr.accept(visitor, first); - } - - /** - * Create an internal model conform to the specified expression. - * Any previous model is disguarded. - * - * This method should only be called once on a {@link SimpleSashWindowsContentProvider}. - *
- * If an expr term have a name, this name is kept in the facade and can be used later in methods like move, delete, ... - * - * @param expr Expression denoting the configuration to create. Must be one of (Folder, HSash, VSash) - * @throws QueryException - * - * TODO Ensure that the method can only be called once. For example, - * let this class extends {@link SimpleSashWindowsContentProvider}, and the constructor - * call this method. - */ - public void createModel(IModelExp expr) throws PagesModelException { - - Object first ; - if( expr instanceof PanelTerm) { - first = getFirstWindowModel(); - } - else { - throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + expr.toString() + ")"); - } - - // Create a surrounding WindowTerm - WindowTerm windowTerm = new WindowTerm((PanelTerm)expr); - - CreateModelInSimpleContentProviderVisitor visitor = new CreateModelInSimpleContentProviderVisitor(contentProvider); - windowTerm.accept(visitor, first); - - // Fill mapping - namesMapping = queryModel(expr); - } - - /** - * Get element in the model. - * Each model element whose corresponding model query part as a name is added to the result map. - * The element is then accessible with the name set in the query part. - * - * @param query - * @return - * @throws QueryException - */ - public Map queryModel(IModelExp query) throws PagesModelException { - - Object first; - if( query instanceof WindowTerm) { - first = getFirstWindowModel(); - } - else if( query instanceof PanelTerm) { - first = getFirstPanelModel(); - } - else { - throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); - } - - QueryVisitor visitor = new QueryVisitor(); - query.accept(visitor, first); - - return visitor.getResult(); - } - - /** - * Get the model of the first the first window (in actual implementation their is only one window). - * @return - */ - private RootModel getFirstWindowModel() { - // Silly method to get the RootModel - return (RootModel)((AbstractPanelModel)contentProvider.getRootModel()).getParent(); - } - - /** - * Get the panel of the first window (in actual implementation their is only one window). - * @return - */ - private AbstractPanelModel getFirstPanelModel() { - // In this implementation, the root is always of type AbstractPanelModel - return (AbstractPanelModel)contentProvider.getRootModel(); - } - - /** - * Add a page to the model - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.common.ISashWindowsContentProviderFacade#addPage(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page, java.lang.String, int) - * - * @param page - * @param folderName - * @param index - * @throws PagesModelException - */ - public void /*IPageModel*/ addPage(Page page, String folderName, int index) throws PagesModelException { - // Get the folder - TabFolderModel folderModel = getITabFolderModel( folderName ); - - IPageModel pageModel = createPageModel(page); - - contentProvider.addPage(folderModel, index, pageModel); - -// return pageModel; - } - - /** - * Add a page to the model - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.common.ISashWindowsContentProviderFacade#addPage(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page, java.lang.String, int) - * - * @param page - * @param folderName - * @throws PagesModelException - */ - public void /*IPageModel*/ addPage(Page page, String folderName) throws PagesModelException { - // Get the folder - TabFolderModel folderModel = getITabFolderModel( folderName ); - - IPageModel pageModel = createPageModel(page); - - contentProvider.addPage(folderModel, pageModel); - -// return pageModel; - } - - /** - * Create a {@link IPageModel} for the specified {@link Page}. - * @param page - * @return - */ - static public IPageModel createPageModel( Page page ) { - return new MessagePartModel( page.getName(), page.getName() ); - } - - /** - * - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.common.ISashWindowsContentProviderFacade#movePage(java.lang.String, int, int) - * - * @param folderName - * @param oldIndex - * @param newIndex - * @throws NotFoundException - */ - public void movePage(String folderName, int oldIndex, int newIndex) throws NotFoundException { - // Get the folder - ITabFolderModel folderModel = getITabFolderModel( folderName ); - - contentProvider.movePage(folderModel, oldIndex, newIndex); - } - - public void movePage(String srcFolderName, int sourceIndex, String targetFolderName, int targetIndex) throws NotFoundException { - // Get the folders - ITabFolderModel srcFolderModel = getITabFolderModel( srcFolderName ); - ITabFolderModel targetFolderModel = getITabFolderModel( targetFolderName ); - - contentProvider.movePage(srcFolderModel, sourceIndex, targetFolderModel, targetIndex); - } - - public void removePage(String pageName) throws NotFoundException { - IPageModel pageModel = getIPageModel(pageName); - - contentProvider.removePage(pageModel); - - } - - public void removePage(String folderName, int tabIndex) throws NotFoundException { - // Get the folder - ITabFolderModel folderModel = getITabFolderModel( folderName ); - - contentProvider.removePage(folderModel, tabIndex); - // TODO remove page name from context - } - - public void createFolder(String tabFolderName, int tabIndex, String targetFolderName, int side) throws PagesModelException { - // Get the folders - ITabFolderModel srcFolderModel = getITabFolderModel( tabFolderName ); - TabFolderModel targetFolderModel = getITabFolderModel( targetFolderName ); - - contentProvider.createFolder(srcFolderModel, tabIndex, targetFolderModel, side); - - } - - /** - * Add an element in namesMapping. Throw an exception if the name already exist or if the name is not correct. - * - * @param name - * @param element - * @throws BadNameException - */ - protected void putNameMapping( String name, Object element) throws BadNameException { - - if( name == null || name.length() == 0 ) { - throw new BadNameException("Name '" + name + "' is not valid."); - } - - if(namesMapping.containsKey(name)) { - throw new BadNameException("Name '" + name + "' already exist in the context. Can't add it (but element is created)."); - } - - } - /** - * Get the {@link ITabFolderModel} associated to the name. - * In this implementation, this is the internal folder. - * @param folderName - * @return - * @throws NotFoundException - */ - public TabFolderModel getITabFolderModel(String folderName) throws NotFoundException { - - - Object res = namesMapping.get(folderName); - if(res == null) - throw new NotFoundException("Folder named '" + folderName + "' not found in the context of the expression."); - - if( ! (res instanceof TabFolderModel) ) - throw new NotFoundException("An element named '" + folderName + "' is found but it is not of the expected type (ITabFolderModel). " ); - - return (TabFolderModel)res; - } - - /** - * Get the {@link IPageModel} associated to the name. - * In this implementation, this is the internal element. - * @param pageName - * @return - * @throws NotFoundException - */ - public IPageModel getIPageModel(String pageName) throws NotFoundException { - - - Object res = namesMapping.get(pageName); - if(res == null) - throw new NotFoundException("Page named '" + pageName + "' not found in the context of the expression."); - - if( ! (res instanceof IPageModel) ) - throw new NotFoundException("An element named '" + pageName + "' is found but it is not of the expected type (IPageModel). " ); - - return (IPageModel)res; - } - - /** - * Return the associated maps of (names, internal representation). - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade#getNamesToInternalMap() - * - * @return - */ - public Map getNamesToInternalMap() { - return namesMapping; - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeCommonTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeCommonTest.java deleted file mode 100644 index fe1c269c852..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeCommonTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.AbstractSashWindowContentProviderFacadeTest; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade; - - -/** - * @author dumoulin - * - */ -public class SimpleSashWindowContainerTestFacadeCommonTest extends AbstractSashWindowContentProviderFacadeTest { - - /** - * Constructor. - * - */ - public SimpleSashWindowContainerTestFacadeCommonTest() { - super(); - } - - /** - * Return the concrete implementation under test. - * @return - */ - @Override - public ISashWindowsContentProviderFacade createISashWindowsContentProviderFacade() { - return new SimpleSashWindowContainerTestFacade(); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeTest.java deleted file mode 100644 index 255bdef7a26..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeTest.java +++ /dev/null @@ -1,91 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - - -/** - * @author dumoulin - * - */ -public class SimpleSashWindowContainerTestFacadeTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContainerTestFacade#SimpleSashWindowContainerTestFacade()}. - */ - @Test - public void testSimpleSashWindowContainerTestFacade() { - SimpleSashWindowContainerTestFacade facade = new SimpleSashWindowContainerTestFacade(); - - assertNotNull("Facade created", facade); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContainerTestFacade#getSashContainer()}. - */ - @Test - public void testGetSashContainer() { - SimpleSashWindowContainerTestFacade facade = new SimpleSashWindowContainerTestFacade(); - - assertNotNull("Facade created", facade); - assertNotNull("container created", facade.getISashWindowsContainer() ); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContainerTestFacade#getIContentProvider()}. - */ - @Test - public void testGetIContentProvider() { - SimpleSashWindowContainerTestFacade facade = new SimpleSashWindowContainerTestFacade(); - - assertNotNull("Facade created", facade); - assertNotNull("contentProvider created", facade.getIContentProvider() ); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContainerTestFacade#dispose()}. - */ - @Test - public void testDispose() { - SimpleSashWindowContainerTestFacade facade = new SimpleSashWindowContainerTestFacade(); - - assertNotNull("Facade created", facade); - - facade.dispose(); - assertNull("contentProvider deleted", facade.getIContentProvider() ); - assertNull("container deleted", facade.getISashWindowsContainer() ); - - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacade.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacade.java deleted file mode 100644 index bfc1716e58d..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacade.java +++ /dev/null @@ -1,368 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; - -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IAbstractPanelModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; -import org.eclipse.papyrus.infra.core.sasheditor.editor.MessagePartModel; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.BadNameException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NotFoundException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PanelTerm; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade; - -/** - * Class providing a facade to test the {@link SimpleSashWindowsContentProvider} class. - *
- * This facade own a {@link SimpleSashWindowsContentProvider} and provide methods to manipulate it with - * the help of names. Each element in the {@link SimpleSashWindowsContentProvider} can be identified - * by a name (String). Then, the facade provide methods similar to {@link ISashWindowsContentProvider}, but using - * names rather than {@link IAbstractPanelModel} and {@link ITabFolderModel}. - *
- * The facade maintains a mapping between the names and the {@link ISashWindowsContentProvider} models. - * - * @author cedric dumoulin - * - */ -public class SimpleSashWindowContentProviderFacade implements ISashWindowsContentProviderFacade { - - /** - * The internal content provider this facade is for. - */ - protected SimpleSashWindowsContentProvider contentProvider; - - /** - * Mapping between names provided in the expressions and internal implementations of the {@link SimpleSashWindowsContentProvider}. - * This mapping is maintained when elements are added or removed. - * - */ - protected Map namesMapping; - - /** - * Constructor. - * Create a default internal {@link SimpleSashWindowsContentProvider}; - * @param modelMngr - */ - public SimpleSashWindowContentProviderFacade() { - this.contentProvider = new SimpleSashWindowsContentProvider(); - } - - /** - * Constructor. - * - * @param modelMngr - */ - public SimpleSashWindowContentProviderFacade(SimpleSashWindowsContentProvider contentProvider) { - this.contentProvider = contentProvider; - } - - /** - * @return the contentProvider - */ - public ISashWindowsContentProvider getIContentProvider() { - return contentProvider; - } - - - /** - * Reset the namesMapping context accordingly to the provided expr. - * A side effect is that the internal structure is checked against the expr. - *
- * Reseting the names context allows to remove or add names to the context. - * It is used to add names of newly created elements (created with addPage() or createFolder() ) - - * @param expr - * @throws PagesModelException - */ - public void resetNamesContext(IModelExp expr) throws PagesModelException { - namesMapping = queryModel(expr); - } - - /** - * Check if the internal {@link ISashWindowsContentProvider} is conformed to the specified expression. - * @param expr - * @throws QueryException - */ - public void assertConform(IModelExp expr) throws PagesModelException { - - Object first; - if( expr instanceof WindowTerm) { - first = getFirstWindowModel(); - } - else if( expr instanceof PanelTerm) { - first = getFirstPanelModel(); - } - else { - throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + expr.toString() + ")"); - } - - CheckVisitor visitor = new CheckVisitor(); - expr.accept(visitor, first); - } - - /** - * Create an internal model conform to the specified expression. - * Any previous model is disguarded. - * - * This method should only be called once on a {@link SimpleSashWindowsContentProvider}. - *
- * If an expr term have a name, this name is kept in the facade and can be used later in methods like move, delete, ... - * - * @param expr Expression denoting the configuration to create. Must be one of (Folder, HSash, VSash) - * @throws QueryException - * - * TODO Ensure that the method can only be called once. For example, - * let this class extends {@link SimpleSashWindowsContentProvider}, and the constructor - * call this method. - */ - public void createModel(IModelExp expr) throws PagesModelException { - - Object first ; - if( expr instanceof PanelTerm) { - first = getFirstWindowModel(); - } - else { - throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + expr.toString() + ")"); - } - - // Create a surrounding WindowTerm - WindowTerm windowTerm = new WindowTerm((PanelTerm)expr); - - CreateModelInSimpleContentProviderVisitor visitor = new CreateModelInSimpleContentProviderVisitor(contentProvider); - windowTerm.accept(visitor, first); - - // Fill mapping - namesMapping = queryModel(expr); - } - - /** - * Get element in the model. - * Each model element whose corresponding model query part as a name is added to the result map. - * The element is then accessible with the name set in the query part. - * - * @param query - * @return - * @throws QueryException - */ - public Map queryModel(IModelExp query) throws PagesModelException { - - Object first; - if( query instanceof WindowTerm) { - first = getFirstWindowModel(); - } - else if( query instanceof PanelTerm) { - first = getFirstPanelModel(); - } - else { - throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); - } - - QueryVisitor visitor = new QueryVisitor(); - query.accept(visitor, first); - - return visitor.getResult(); - } - - /** - * Get the model of the first the first window (in actual implementation their is only one window). - * @return - */ - private RootModel getFirstWindowModel() { - // Silly method to get the RootModel - return (RootModel)((AbstractPanelModel)contentProvider.getRootModel()).getParent(); - } - - /** - * Get the panel of the first window (in actual implementation their is only one window). - * @return - */ - private AbstractPanelModel getFirstPanelModel() { - // In this implementation, the root is always of type AbstractPanelModel - return (AbstractPanelModel)contentProvider.getRootModel(); - } - - /** - * Add a page to the model - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.common.ISashWindowsContentProviderFacade#addPage(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page, java.lang.String, int) - * - * @param page - * @param folderName - * @param index - * @throws PagesModelException - */ - public void /*IPageModel*/ addPage(Page page, String folderName, int index) throws PagesModelException { - // Get the folder - TabFolderModel folderModel = getITabFolderModel( folderName ); - - IPageModel pageModel = createPageModel(page); - - contentProvider.addPage(folderModel, index, pageModel); - -// return pageModel; - } - - /** - * Add a page to the model - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.common.ISashWindowsContentProviderFacade#addPage(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page, java.lang.String, int) - * - * @param page - * @param folderName - * @throws PagesModelException - */ - public void /*IPageModel*/ addPage(Page page, String folderName) throws PagesModelException { - // Get the folder - TabFolderModel folderModel = getITabFolderModel( folderName ); - - IPageModel pageModel = createPageModel(page); - - contentProvider.addPage(folderModel, pageModel); - -// return pageModel; - } - - /** - * Create a {@link IPageModel} for the specified {@link Page}. - * @param page - * @return - */ - static public IPageModel createPageModel( Page page ) { - return new MessagePartModel( page.getName(), page.getName() ); - } - - /** - * - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.common.ISashWindowsContentProviderFacade#movePage(java.lang.String, int, int) - * - * @param folderName - * @param oldIndex - * @param newIndex - * @throws NotFoundException - */ - public void movePage(String folderName, int oldIndex, int newIndex) throws NotFoundException { - // Get the folder - ITabFolderModel folderModel = getITabFolderModel( folderName ); - - contentProvider.movePage(folderModel, oldIndex, newIndex); - } - - public void movePage(String srcFolderName, int sourceIndex, String targetFolderName, int targetIndex) throws NotFoundException { - // Get the folders - ITabFolderModel srcFolderModel = getITabFolderModel( srcFolderName ); - ITabFolderModel targetFolderModel = getITabFolderModel( targetFolderName ); - - contentProvider.movePage(srcFolderModel, sourceIndex, targetFolderModel, targetIndex); - } - - public void removePage(String pageName) throws NotFoundException { - IPageModel pageModel = getIPageModel(pageName); - - contentProvider.removePage(pageModel); - - } - - public void removePage(String folderName, int tabIndex) throws NotFoundException { - // Get the folder - ITabFolderModel folderModel = getITabFolderModel( folderName ); - - contentProvider.removePage(folderModel, tabIndex); - // TODO remove page name from context - } - - public void createFolder(String tabFolderName, int tabIndex, String targetFolderName, int side) throws PagesModelException { - // Get the folders - ITabFolderModel srcFolderModel = getITabFolderModel( tabFolderName ); - TabFolderModel targetFolderModel = getITabFolderModel( targetFolderName ); - - contentProvider.createFolder(srcFolderModel, tabIndex, targetFolderModel, side); - - } - - /** - * Add an element in namesMapping. Throw an exception if the name already exist or if the name is not correct. - * - * @param name - * @param element - * @throws BadNameException - */ - protected void putNameMapping( String name, Object element) throws BadNameException { - - if( name == null || name.length() == 0 ) { - throw new BadNameException("Name '" + name + "' is not valid."); - } - - if(namesMapping.containsKey(name)) { - throw new BadNameException("Name '" + name + "' already exist in the context. Can't add it (but element is created)."); - } - - } - /** - * Get the {@link ITabFolderModel} associated to the name. - * In this implementation, this is the internal folder. - * @param folderName - * @return - * @throws NotFoundException - */ - public TabFolderModel getITabFolderModel(String folderName) throws NotFoundException { - - - Object res = namesMapping.get(folderName); - if(res == null) - throw new NotFoundException("Folder named '" + folderName + "' not found in the context of the expression."); - - if( ! (res instanceof TabFolderModel) ) - throw new NotFoundException("An element named '" + folderName + "' is found but it is not of the expected type (ITabFolderModel). " ); - - return (TabFolderModel)res; - } - - /** - * Get the {@link IPageModel} associated to the name. - * In this implementation, this is the internal element. - * @param pageName - * @return - * @throws NotFoundException - */ - public IPageModel getIPageModel(String pageName) throws NotFoundException { - - - Object res = namesMapping.get(pageName); - if(res == null) - throw new NotFoundException("Page named '" + pageName + "' not found in the context of the expression."); - - if( ! (res instanceof IPageModel) ) - throw new NotFoundException("An element named '" + pageName + "' is found but it is not of the expected type (IPageModel). " ); - - return (IPageModel)res; - } - - /** - * Return the associated maps of (names, internal representation). - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade#getNamesToInternalMap() - * - * @return - */ - public Map getNamesToInternalMap() { - return namesMapping; - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest.java deleted file mode 100644 index f633f705aa4..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest.java +++ /dev/null @@ -1,151 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; - -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.folder; -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.page; -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.vSash; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; -import org.eclipse.swt.SWT; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - - -/** - * @author dumoulin - * - */ -public class SimpleSashWindowContentProviderFacadeTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#assertConform(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. - * @throws PagesModelException - */ - @Test - public void testAssertConform() throws PagesModelException { - SimpleSashWindowContentProviderFacade helper = new SimpleSashWindowContentProviderFacade(); - - assertNotNull("helper created", helper); - // Create a query - IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); - // Try to create the model - helper.createModel(expr); - - // Try to check model - helper.assertConform(expr); - - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#createModel(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. - * @throws PagesModelException - */ - @Test - public void testCreateModel() throws PagesModelException { - SimpleSashWindowContentProviderFacade helper = new SimpleSashWindowContentProviderFacade(); - - assertNotNull("helper created", helper); - // Create a query - IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); - // Try to create the model - helper.createModel(expr); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#queryModel(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. - * @throws PagesModelException - */ - @Test - public void testQueryModel() throws PagesModelException { - SimpleSashWindowContentProviderFacade helper = new SimpleSashWindowContentProviderFacade(); - - assertNotNull("helper created", helper); - // Create a query - IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); - // Try to create the model - helper.createModel(expr); - - // Query model - Map res = helper.queryModel(expr); - assertNotNull("found f1", res.get("f1")); - assertTrue("right type", res.get("f1") instanceof TabFolderModel ); - - assertNotNull("found f2", res.get("f2")); - assertTrue("right type", res.get("f2") instanceof TabFolderModel ); - - assertNotNull("found p2", res.get("p2")); - assertTrue("right type", res.get("p2") instanceof IPageModel ); - } - - /** - * Test folder creation. - * Use the pagemodels utilities {@link SimpleSashWindowContentProviderUtils}. - * @throws PagesModelException - */ - @Test - public void testCreateFolder() throws PagesModelException { - - - SimpleSashWindowContentProviderFacade helper = new SimpleSashWindowContentProviderFacade(); - - assertNotNull("helper created", helper); - // Create a query -// IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); - IModelExp expr = folder( "f1", page("p1"), page("p2"), page("p3"), page("p4"), - page("p5"), page("p6"), page("p7"), page("p8")); - // Try to create the model - helper.createModel(expr); - - // Create another folder - helper.createFolder("f1", 0, "f1", SWT.UP); - // Check the content configuration - IModelExp conf1Expr = vSash( - folder( "f2", page("p1") ), - folder( "f1", page("p2"), page("p3"), page("p4"), - page("p5"), page("p6"), page("p7"), page("p8") ) - ); - // Check if conform - helper.assertConform(conf1Expr); - - // Check resetContext - helper.resetNamesContext(conf1Expr); - - assertNotNull("new name found", helper.getITabFolderModel("f2")); - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest2.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest2.java deleted file mode 100644 index a27b626cd94..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest2.java +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.AbstractSashWindowContentProviderFacadeTest; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade; - - -/** - * @author dumoulin - * - */ -public class SimpleSashWindowContentProviderFacadeTest2 extends AbstractSashWindowContentProviderFacadeTest { - - /** - * Constructor. - * - */ - public SimpleSashWindowContentProviderFacadeTest2() { - super(); - } - - /** - * Return the concrete implementation under test. - * @return - */ - @Override - public ISashWindowsContentProviderFacade createISashWindowsContentProviderFacade() { - return new SimpleSashWindowContentProviderFacade(); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtils.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtils.java deleted file mode 100644 index 57e3a539b50..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtils.java +++ /dev/null @@ -1,168 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; - -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PanelTerm; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; -import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.ISashWindowsContentProviderTestUtils; - -/** - * Class providing some utilities to check the {@link SimpleSashWindowsContentProvider} class. - *
- * This utilities allow to: populate a contentProvider, compare the contentProvider structure - * query the contentProvider structure. - * - * @author cedric dumoulin - * - */ -public class SimpleSashWindowContentProviderUtils implements ISashWindowsContentProviderTestUtils { - - /** - * ContentProvider used . - */ - protected SimpleSashWindowsContentProvider contentProvider; - - /** - * Constructor. - * Create a default internal {@link SimpleSashWindowsContentProvider}; - * @param modelMngr - */ - public SimpleSashWindowContentProviderUtils() { - this.contentProvider = new SimpleSashWindowsContentProvider(); - } - - /** - * Constructor. - * - * @param modelMngr - */ - public SimpleSashWindowContentProviderUtils(SimpleSashWindowsContentProvider contentProvider) { - this.contentProvider = contentProvider; - } - - - - /** - * @return the contentProvider - */ - public ISashWindowsContentProvider getIContentProvider() { - return contentProvider; - } - - - /** - * Check if the sashModel is conformed to the specified query. - * @param query - * @throws QueryException - */ - public void assertConform(IModelExp query) throws PagesModelException { - - Object first; - if( query instanceof WindowTerm) { - first = getFirstWindowModel(); - } - else if( query instanceof PanelTerm) { - first = getFirstPanelModel(); - } - else { - throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); - } - - CheckVisitor visitor = new CheckVisitor(); - query.accept(visitor, first); - } - - /** - * Create an internal model conform to the specified query. - * Any previous model is disguarded. - * - * This method should only be called once on a {@link SimpleSashWindowsContentProvider}. - * - * @param query Should be a subtype PanelTerm (Folder, HSash, VSash) - * @throws QueryException - * - * TODO Ensure that the method can only be called once. For example, - * let this class extends {@link SimpleSashWindowsContentProvider}, and the constructor - * call this method. - */ - public void createModel(IModelExp query) throws PagesModelException { - - Object first ; - if( query instanceof PanelTerm) { - first = getFirstWindowModel(); - } - else { - throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); - } - - // Create a surrounding WindowTerm - WindowTerm windowTerm = new WindowTerm((PanelTerm)query); - - CreateModelInSimpleContentProviderVisitor visitor = new CreateModelInSimpleContentProviderVisitor(contentProvider); - windowTerm.accept(visitor, first); - } - - /** - * Get element in the model. - * Each model element whose corresponding model query part as a name is added to the result map. - * The element is then accessible with the name set in the query part. - * - * @param query - * @return - * @throws QueryException - */ - public Map queryModel(IModelExp query) throws PagesModelException { - - Object first; - if( query instanceof WindowTerm) { - first = getFirstWindowModel(); - } - else if( query instanceof PanelTerm) { - first = getFirstPanelModel(); - } - else { - throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); - } - - QueryVisitor visitor = new QueryVisitor(); - query.accept(visitor, first); - - return visitor.getResult(); - } - - /** - * Get the model of the first the first window (in actual implementation their is only one window). - * @return - */ - private RootModel getFirstWindowModel() { - // Silly method to get the RootModel - return (RootModel)((AbstractPanelModel)contentProvider.getRootModel()).getParent(); - } - - /** - * Get the panel of the first window (in actual implementation their is only one window). - * @return - */ - private AbstractPanelModel getFirstPanelModel() { - // In this implementation, the root is always of type AbstractPanelModel - return (AbstractPanelModel)contentProvider.getRootModel(); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtilsTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtilsTest.java deleted file mode 100644 index 2c3ee148e8d..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtilsTest.java +++ /dev/null @@ -1,115 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; - -import static org.junit.Assert.*; - -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; - -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - - -/** - * @author dumoulin - * - */ -public class SimpleSashWindowContentProviderUtilsTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#assertConform(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. - * @throws PagesModelException - */ - @Test - public void testAssertConform() throws PagesModelException { - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); - - assertNotNull("helper created", helper); - // Create a query - IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); - // Try to create the model - helper.createModel(expr); - - // Try to check model - helper.assertConform(expr); - - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#createModel(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. - * @throws PagesModelException - */ - @Test - public void testCreateModel() throws PagesModelException { - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); - - assertNotNull("helper created", helper); - // Create a query - IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); - // Try to create the model - helper.createModel(expr); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#queryModel(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. - * @throws PagesModelException - */ - @Test - public void testQueryModel() throws PagesModelException { - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); - - assertNotNull("helper created", helper); - // Create a query - IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); - // Try to create the model - helper.createModel(expr); - - // Query model - Map res = helper.queryModel(expr); - assertNotNull("found f1", res.get("f1")); - assertTrue("right type", res.get("f1") instanceof TabFolderModel ); - - assertNotNull("found f2", res.get("f2")); - assertTrue("right type", res.get("f2") instanceof TabFolderModel ); - - assertNotNull("found p2", res.get("p2")); - assertTrue("right type", res.get("p2") instanceof IPageModel ); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowsContentProviderTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowsContentProviderTest.java deleted file mode 100644 index 9c7e183c644..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowsContentProviderTest.java +++ /dev/null @@ -1,326 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009 CEA LIST & LIFL - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; - -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.folder; -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.hSash; -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.page; -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.vSash; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; -import org.eclipse.swt.SWT; -import org.junit.Before; -import org.junit.Test; - - -/** - * @author cedric dumoulin - */ -public class SimpleSashWindowsContentProviderTest /* extends AbstractPapyrusTest */{ - - protected SimpleSashWindowsContentProvider contentProvider; - - /** - * Initialize the tree {@inheritDoc} - */ - @Before - public void setUp() throws Exception { - createContentProvider(); - } - - /** - * Create a tree - */ - private void createContentProvider() { - contentProvider = new SimpleSashWindowsContentProvider(); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#addPage(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel)} - * . - */ - @Test - public void testAddTabIPageModel() { - IPageModel newModel = new FakePageModel(); - contentProvider.addPage(newModel); - - assertTrue("Folder contains added item", contentProvider.getCurrentTabFolder().getChildren().contains(newModel)); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#movePage(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int, int)} - * . - */ - // public void testMoveTabITabFolderModelIntInt() { - // fail("Not yet implemented"); - // } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#movePage(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int, org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int)} - * . - */ - // public void testMoveTabITabFolderModelIntITabFolderModelInt() { - // fail("Not yet implemented"); - // } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#createFolder(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int, org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int)} - * . - */ - @Test - public void testCreateFolder() { - - // Create pages and add them to the default folder - List models = new ArrayList(); - for(int i = 0; i < 8; i++) { - IPageModel newModel = new FakePageModel("model" + i); - contentProvider.addPage(newModel); - models.add(newModel); - } - - ITabFolderModel folder = contentProvider.getCurrentTabFolder(); - - // // Do move tab 0 to right - // ITabFolderModel newFolder = contentProvider.createFolder(folder, 0, folder, SWT.RIGHT); - // // Check creation - // assertNotNull("Folder created", newFolder); - // // Check if correctly attached and reachable - // assertEquals("Tab 2 added in correct folder", folder, contentProvider.getParentFolder(newModel2)); - // assertEquals("Tab 1 added in correct folder", newFolder, contentProvider.getParentFolder(newModel1)); - // - //// assertNotNull("folder attached", contentProvider.getParentFolder(newModel1)); - //// assertNotNull("folder attached", contentProvider.getParentFolder(newModel1)); - // - // assertTrue("Folder contains added item", newFolder.getChildren().contains(newModel1)); - // assertTrue("Folder contains added item", folder.getChildren().contains(newModel2)); - - - // - // Create another folder - int index = 0; - IPageModel movedTab = models.get(index++); - assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); - contentProvider.createFolder(folder, 0, folder, SWT.UP); - // Find created folder - ITabFolderModel newFolder2 = contentProvider.getParentFolder(movedTab); - assertFolderCreated(folder, newFolder2, movedTab); - - movedTab = models.get(index++); - assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); - contentProvider.createFolder(folder, 0, newFolder2, SWT.UP); - ITabFolderModel newFolder3 = contentProvider.getParentFolder(movedTab); - assertFolderCreated(folder, newFolder3, movedTab); - - movedTab = models.get(index++); - assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); - contentProvider.createFolder(folder, 0, newFolder2, SWT.DOWN); - ITabFolderModel newFolder4 = contentProvider.getParentFolder(movedTab); - assertFolderCreated(folder, newFolder4, movedTab); - - movedTab = models.get(index++); - assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); - contentProvider.createFolder(folder, 0, folder, SWT.LEFT); - ITabFolderModel newFolder5 = contentProvider.getParentFolder(movedTab); - assertFolderCreated(folder, newFolder5, movedTab); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#createFolder(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int, org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int)} - * . - */ - @Test - public void testCreateFolder_ITabFolderModel_int() { - - // Create pages and add them to the default folder - List models = new ArrayList(); - for(int i = 0; i < 8; i++) { - IPageModel newModel = new FakePageModel("model" + i); - contentProvider.addPage(newModel); - models.add(newModel); - } - - ITabFolderModel referenceFolder = contentProvider.getCurrentTabFolder(); - - assertNotNull("referenceFolder exist", referenceFolder); - - // Create a new folder. - ITabFolderModel createdFolder = contentProvider.createFolder(referenceFolder, SWT.TOP); - - assertNotNull("folder created", createdFolder); - - } - - /** - * Assert folder is correctly created - * - * @param srcFolder - * @param newFolder - * @param movedTab - */ - protected void assertFolderCreated(ITabFolderModel srcFolder, ITabFolderModel newFolder, IPageModel movedTab) { - // Check creation - assertNotNull("Folder exist", newFolder); - - // Check if it is really a new folder - assertNotSame("Old folder and new folder are differents", srcFolder, newFolder); - - // Check removed from source - assertFalse("item removed from source folder", srcFolder.getChildren().contains(movedTab)); - // Check contained in created folder - assertTrue("Folder contains added item", newFolder.getChildren().contains(movedTab)); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#removePage(int)}. - */ - // public void testRemoveTabInt() { - // fail("Not yet implemented"); - // } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#movePage(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int, int)} - * . - */ - // public void testMoveTabITabFolderModelIntInt() { - // fail("Not yet implemented"); - // } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#movePage(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int, org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int)} - * . - */ - // public void testMoveTabITabFolderModelIntITabFolderModelInt() { - // fail("Not yet implemented"); - // } - - /** - * Test folder creation. - * Use the pagemodels utilities {@link SimpleSashWindowContentProviderUtils}. - * - * @throws PagesModelException - */ - @Test - public void testCreateFolder2() throws PagesModelException { - - - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); - - assertNotNull("helper created", helper); - // Create a query - // IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); - IModelExp expr = folder("f1", page("p1"), page("p2"), page("p3"), page("p4"), page("p5"), page("p6"), page("p7"), page("p8")); - // Try to create the model - helper.createModel(expr); - - // Query model - Map res = helper.queryModel(expr); - // Get a folder - ITabFolderModel folder = (ITabFolderModel)res.get("f1"); - - // Create another folder - IPageModel movedTab = (IPageModel)res.get("p1"); - assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); - contentProvider.createFolder(folder, 0, folder, SWT.UP); - // Find created folder - ITabFolderModel newFolder2 = contentProvider.getParentFolder(movedTab); - assertFolderCreated(folder, newFolder2, movedTab); - - // Check the content configuration - IModelExp conf1Expr = vSash(folder("f2", page("p1")), folder("f1", page("p2"), page("p3"), page("p4"), page("p5"), page("p6"), page("p7"), page("p8"))); - // Check if conform - helper.assertConform(conf1Expr); - - Map conf1 = helper.queryModel(conf1Expr); - assertEquals("right page moved", res.get("p1"), conf1.get("p1")); - - - - movedTab = (IPageModel)res.get("p2"); - assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); - contentProvider.createFolder(folder, 0, newFolder2, SWT.UP); - ITabFolderModel newFolder3 = contentProvider.getParentFolder(movedTab); - assertFolderCreated(folder, newFolder3, movedTab); - - // Check the content configuration - IModelExp conf2Expr = vSash(vSash(folder("f3", page("p2")), folder("f2", page("p1"))), folder("f1", page("p3"), page("p4"), page("p5"), page("p6"), page("p7"), page("p8"))); - // Check if conform - helper.assertConform(conf2Expr); - - Map conf2 = helper.queryModel(conf2Expr); - assertEquals("right page moved", res.get("p2"), conf2.get("p2")); - - - // Next move - movedTab = (IPageModel)res.get("p3"); - assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); - contentProvider.createFolder(folder, 0, newFolder2, SWT.DOWN); - ITabFolderModel newFolder4 = contentProvider.getParentFolder(movedTab); - assertFolderCreated(folder, newFolder4, movedTab); - - // Check the content configuration - IModelExp conf3Expr = vSash(vSash(folder("f3", page("p2")), vSash(folder("f2", page("p1")), folder("f4", page("p3")))), folder("f1", page("p4"), page("p5"), page("p6"), page("p7"), page("p8"))); - // Check if conform - helper.assertConform(conf3Expr); - - Map conf3 = helper.queryModel(conf3Expr); - assertEquals("right page moved", res.get("p3"), conf3.get("p3")); - - // Move next folder - movedTab = (IPageModel)res.get("p4"); - assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); - contentProvider.createFolder(folder, 0, folder, SWT.LEFT); - ITabFolderModel newFolder5 = contentProvider.getParentFolder(movedTab); - assertFolderCreated(folder, newFolder5, movedTab); - - // Check the content configuration - IModelExp conf4Expr = vSash(vSash(folder("f3", page("p2")), vSash(folder("f2", page("p1")), folder("f4", page("p3")))), hSash(folder("f5", page("p4")), folder("f1", page("p5"), page("p6"), page("p7"), page("p8")))); - // Check if conform - helper.assertConform(conf4Expr); - - Map conf4 = helper.queryModel(conf4Expr); - assertEquals("right page moved", res.get("p4"), conf4.get("p4")); - - - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#removePage(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel)} - * . - */ - // public void testRemoveTabIPageModel() { - // fail("Not yet implemented"); - // } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/AllTests.java deleted file mode 100644 index a0a4f43ac66..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/AllTests.java +++ /dev/null @@ -1,26 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010 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 - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.editor; - -import org.junit.runner.RunWith; -import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; -import org.junit.runners.Suite.SuiteClasses; - - -/** - * All tests for package org.eclipse.papyrus.infra.core.sasheditor.editor - */ -@RunWith(ClassificationSuite.class) -@SuiteClasses({ SashMultiPageEditorTest.class }) -public class AllTests { - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/FakeEditorModel.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/FakeEditorModel.java deleted file mode 100644 index 48743bbda55..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/FakeEditorModel.java +++ /dev/null @@ -1,137 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010, 2014 LIFL, 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: - * - * LIFL - Initial API and implementation - * Christian W. Damus (CEA) - bug 392301 - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.editor; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.part.EditorActionBarContributor; -import org.eclipse.ui.part.EditorPart; - - -/** - * A simple model that can be used as editor in tests. - * @author cedric dumoulin - * - */ -public class FakeEditorModel implements IEditorModel { - - - private String name; - - public FakeEditorModel() { - name = "noname"; - } - - public void dispose() { - // Pass - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel#getTabTitle() - * - * @return - */ - public String getTabTitle() { - return name; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel#getTabIcon() - * - * @return - */ - public Image getTabIcon() { - return null; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel#getRawModel() - * - * @return - */ - public Object getRawModel() { - // TODO Auto-generated method stub - return this; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel#createIEditorPart() - * - * @return - * @throws PartInitException - */ - public IEditorPart createIEditorPart() throws PartInitException { - return new FakeEditorPart(); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel#getActionBarContributor() - * - * @return - */ - public EditorActionBarContributor getActionBarContributor() { - return null; - } - - /** - * A class implementing a fake editor. - * @author dumoulin - * - */ - public class FakeEditorPart extends EditorPart { - - @Override - public void doSave(IProgressMonitor monitor) { - } - - @Override - public void doSaveAs() { - } - - @Override - public void init(IEditorSite site, IEditorInput input) throws PartInitException { - setSite(site); - setInput(input); - setPartName(input.getName()); - } - - @Override - public boolean isDirty() { - return false; - } - - @Override - public boolean isSaveAsAllowed() { - return false; - } - - @Override - public void createPartControl(Composite parent) { - // do nothing - - } - - @Override - public void setFocus() { - } - - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/MessagePartModel.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/MessagePartModel.java deleted file mode 100644 index 89961918174..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/MessagePartModel.java +++ /dev/null @@ -1,90 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009, 2014 LIFL, 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: - * - * LIFL - Initial API and implementation - * Christian W. Damus (CEA) - bug 392301 - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.editor; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IComponentModel; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; - -/** - * Description of the first page - * - * @author dumoulin - */ - -public class MessagePartModel implements IComponentModel { - - private String title; - - private String msg; - - static private int count = 0; - - - /** - * - */ - public MessagePartModel(String msg) { - title = "newMsg " + count++; - this.msg = msg; - } - - /** - * @param title - */ - public MessagePartModel(String title, String msg) { - this.title = title; - this.msg = msg; - } - - /** - * Return the control to be shown. {@inheritDoc} - */ - public Composite createPartControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - FillLayout layout = new FillLayout(); - composite.setLayout(layout); - StyledText text; - - text = new StyledText(composite, SWT.H_SCROLL | SWT.V_SCROLL); - text.setEditable(false); - - text.setText(" " + msg + " - " + getTabTitle()); - return composite; - } - - public Image getTabIcon() { - return null; - } - - public String getTabTitle() { - return title; - } - - /** - * Return this. In this implementation, the rawModel and the IEditorModel are the same. - * - */ - public Object getRawModel() { - return this; - } - - public void dispose() { - // Pass - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/SashMultiPageEditorTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/SashMultiPageEditorTest.java deleted file mode 100644 index b6d7bf23fd9..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/SashMultiPageEditorTest.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.infra.core.sasheditor.editor; - -import org.junit.Ignore; -import org.junit.Test; - - - -/** - * @author dumoulin - */ -public class SashMultiPageEditorTest { - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.editor.AbstractMultiPageSashEditor#refreshTabs()}. - */ - @Ignore("Not yet implemented") - @Test - public void testRefreshTabs() { - // fail("Not yet implemented"); // TODO - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/ShellEditor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/ShellEditor.java deleted file mode 100644 index 9d9f754fda6..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/ShellEditor.java +++ /dev/null @@ -1,113 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009 CEA LIST & LIFL - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.editor; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - - -/** - * A standalone application testing the Sash system. - * It must be run as Java program. - * - * @author dumoulin - */ -public class ShellEditor { - - protected SashWindowsContainer sashContainer; - - protected ISashWindowsContentProvider contentProvider; - - /** - * Constructor. - * - * @param parent - */ - public ShellEditor(Shell parent) { - parent.setText(this.getClass().getSimpleName()); - init(); - createPartControl(parent); - - // add tabItem - int count = 0; - IPageModel tabItem = new MessagePartModel("msg" + count++); - contentProvider.addPage(tabItem); - tabItem = new MessagePartModel("msg" + count++); - contentProvider.addPage(tabItem); - - sashContainer.refreshTabs(); - } - - /** - * init th class - */ - protected void init() { - contentProvider = new SimpleSashWindowsContentProvider(); - sashContainer = new SashWindowsContainer(); - - initContentProvider(); - sashContainer.setContentProvider(contentProvider); - - } - - /** - * Create some windows. - */ - protected void initContentProvider() { - int count = 0; - IPageModel tabItem = new MessagePartModel("msg" + count++); - contentProvider.addPage(tabItem); - - tabItem = new MessagePartModel("msg0" + count++); - contentProvider.addPage(tabItem); - } - - /** - * Create SWT control of this class - * - * @param parent - */ - protected void createPartControl(Composite parent) { - // Text newText = new Text(parent, SWT.BORDER & SWT.SCROLL_PAGE); - - sashContainer.createPartControl(parent); - } - - /** - * @param args - */ - public static void main(String[] args) { - Display display = new Display(); - - Shell shell = new Shell(display); - shell.setLayout(new FillLayout()); - new ShellEditor(shell); - - shell.open(); - - while(!shell.isDisposed()) { - if(!display.readAndDispatch()) - display.sleep(); - } - - display.dispose(); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/AllTests.java deleted file mode 100644 index 3a9596c2010..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/AllTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010 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 - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.internal; - -import org.junit.runner.RunWith; -import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; -import org.junit.runners.Suite.SuiteClasses; - - -/** - * All tests for package org.eclipse.papyrus.infra.core.sasheditor.internal - */ -@RunWith(ClassificationSuite.class) -@SuiteClasses({ SashContainerEventsProviderTest.class, - PageLifeCycleEventsThrownFromContainerTest.class, - SashWindowsContainerTest.class , - SashWindowsContainerDisposeCalledTest.class, - SashWindowsContainerMemoryLeakTest.class - }) -public class AllTests { - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeFolderLifeCycleEventsListener.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeFolderLifeCycleEventsListener.java deleted file mode 100644 index 5dbff211240..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeFolderLifeCycleEventsListener.java +++ /dev/null @@ -1,143 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.internal; - -import java.util.ArrayList; -import java.util.List; - - -/** - * A fake listener implementation for testing purpose. - * @author cedric dumoulin - * - */ -public class FakeFolderLifeCycleEventsListener implements ITabFolderPartLifeCycleEventsListener { - - public static final String FOLDER_CREATED = "folderCreated"; - - public static final String FOLDER_DISPOSED = "folderDisposed"; - - - /** */ - public int eventCount = 0; - - /** */ - public List traces; - - /** */ - public List events; - - /** - * - * Constructor. - * - */ - public FakeFolderLifeCycleEventsListener() { - traces = new ArrayList(); - events = new ArrayList(); - } - - - /** - * @return the eventCount - */ - public int getEventCount() { - return eventCount; - } - - - /** - * @return the trace - */ - public List getTraces() { - return traces; - } - - /** - * @return the trace - */ - public String getTrace(int index) { - return traces.get(index); - } - - /** - * @return the trace - */ - public List getEvents() { - return events; - } - - /** - * @return the trace - */ - public TabFolderPart getEvent(int index) { - return events.get(index); - } - - /** - * - */ - public void resetChangeCount() { - eventCount = 0; - } - - /** - * - */ - public void resetTraces() { - traces.clear(); - events.clear(); - } - - /* ************************** */ - /* Methods */ - /* ************************** */ - - - public void folderCreated(TabFolderPart folder) { - traces.add(FOLDER_CREATED); - events.add(folder); - eventCount++; - } - - - public void folderDisposed(TabFolderPart folder) { - traces.add(FOLDER_DISPOSED); - events.add(folder); - eventCount++; - } - - @Override - public String toString() { - - StringBuffer buf = new StringBuffer(); - buf.append("{"); - for( int i=0; i traces; - - /** */ - public List events; - - /** - * - * Constructor. - * - */ - public FakePageLifeCycleEventsListener() { - traces = new ArrayList(); - events = new ArrayList(); - } - - - /** - * @return the eventCount - */ - public int getEventCount() { - return eventCount; - } - - - /** - * @return the trace - */ - public List getTraces() { - return traces; - } - - /** - * @return the trace - */ - public String getTrace(int index) { - return traces.get(index); - } - - /** - * @return the trace - */ - public List getEvents() { - return events; - } - - /** - * @return the trace - */ - public IPage getEvent(int index) { - return events.get(index); - } - - /** - * - */ - public void resetChangeCount() { - eventCount = 0; - } - - /** - * - */ - public void resetTraces() { - traces.clear(); - events.clear(); - } - - /* ************************** */ - /* Methods */ - /* ************************** */ - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.editor.IPageChangedListener#pageChanged(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage) - * - * @param newPage - */ - public void pageChanged(IPage newPage) { - traces.add(PAGE_CHANGED); - events.add(newPage); - eventCount++; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.IPageLifeCycleEventsListener#pageOpened(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage) - * - * @param page - */ - public void pageOpened(IPage page) { - traces.add(PAGE_OPENED); - events.add(page); - eventCount++; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.IPageLifeCycleEventsListener#pageClosed(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage) - * - * @param page - */ - public void pageClosed(IPage page) { - traces.add(PAGE_CLOSED); - events.add(page); - eventCount++; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.IPageLifeCycleEventsListener#pageActivated(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage) - * - * @param page - */ - public void pageActivated(IPage page) { - traces.add(PAGE_ACTIVATED); - events.add(page); - eventCount++; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.IPageLifeCycleEventsListener#pageDeactivated(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage) - * - * @param page - */ - public void pageDeactivated(IPage page) { - traces.add(PAGE_DEACTIVATED); - events.add(page); - eventCount++; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.IPageLifeCycleEventsListener#pageAboutToBeOpened(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage) - * - * @param page - */ - public void pageAboutToBeOpened(IPage page) { - traces.add(PAGE_ABOUTTOBEOPENED); - events.add(page); - eventCount++; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.IPageLifeCycleEventsListener#pageAboutToBeClosed(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage) - * - * @param page - */ - public void pageAboutToBeClosed(IPage page) { - traces.add(PAGE_ABOUTTOBECLOSED); - events.add(page); - eventCount++; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakePagePart.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakePagePart.java deleted file mode 100644 index e75eddb62b7..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakePagePart.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.infra.core.sasheditor.internal; - -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - - -/** - * A Page part for testing purpose. This page cannot be used in the SashContainer. - * @author cedric dumoulin - * - */ -public class FakePagePart extends PagePart { - - public FakePagePart() { - super(null, null); - } - - @Override - boolean visit(IPartVisitor visitor) { - // TODO Auto-generated method stub - return false; - } - - @Override - public void createPartControl(Composite parent) { - // TODO Auto-generated method stub - - } - - @Override - public Control getControl() { - // TODO Auto-generated method stub - return null; - } - - @Override - public void reparent(TabFolderPart parent) { - // TODO Auto-generated method stub - - } - - @Override - public void setFocus() { - // TODO Auto-generated method stub - - } - - @Override - public void garbage() { - // TODO Auto-generated method stub - - } - - @Override - public void dispose() { - // TODO Auto-generated method stub - - } - - @Override - public void disposeThisAndChildren() { - // TODO Auto-generated method stub - - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeTabFolderPart.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeTabFolderPart.java deleted file mode 100644 index f1f823a595e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeTabFolderPart.java +++ /dev/null @@ -1,36 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.internal; - - -/** - * A fake {@link TabFolderPart} for testing purpose. - * Do not use in a SashContainer. - * This class allows to instanciate a {@link TabFolderPart}. - * - * @author cedric dumoulin - * - */ -public class FakeTabFolderPart extends TabFolderPart { - - /** - * Create a fake {@link TabFolderPart} - * Constructor. - * - */ - public FakeTabFolderPart() { - super( new RootPart(null), null, null); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FolderLifeCycleEventsThrownFromContainerTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FolderLifeCycleEventsThrownFromContainerTest.java deleted file mode 100644 index 1cb877459b3..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FolderLifeCycleEventsThrownFromContainerTest.java +++ /dev/null @@ -1,163 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.internal; - -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.folder; -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.page; -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.vSash; -import static org.junit.Assert.assertEquals; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContainerTestFacade; -import org.eclipse.papyrus.infra.core.sasheditor.editor.IPage; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; -import org.eclipse.swt.SWT; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - - -/** - * Test if the {@link SashWindowsContainer} send the events of a folder lifecycle. - * Test if the folder lifecycle events are correctly thrown by the {@link SashWindowsContainer} when - * folder are added/removed, ... - * - * @author cedric dumoulin - * - */ -public class FolderLifeCycleEventsThrownFromContainerTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - - /** - * Lookup a page by its raw model. - * @param container - * @param rawModel - * @return - */ - protected IPage lookupTabFolderPart(SashWindowsContainer container, Object rawModel) { - - LookupModelPageVisitor visitor = new LookupModelPageVisitor(rawModel); - container.visit(visitor); - return visitor.result(); - } - - - /** - * Test if the FOLDER_ADDED event is sent when a folder is added. - * @throws PagesModelException - */ - @Test - public void testFolderAddedEvent() throws PagesModelException { - - SimpleSashWindowContainerTestFacade containerFacade = new SimpleSashWindowContainerTestFacade(); - // get container and contentProvider - ISashWindowsContentProvider contentProvider = containerFacade.getIContentProvider(); - SashWindowsContainer container = containerFacade.getSashContainer(); - - // Create listener and attach it - FakeFolderLifeCycleEventsListener listener = new FakeFolderLifeCycleEventsListener(); - container.getFolderLifeCycleEventProvider().addListener(listener); - - // init the container - IModelExp expr = vSash( - folder( "f1", page("p2"), page("p3"), page("p4") ), - folder( "f2", page("p1") ) - ); - containerFacade.createModel(expr); - - // Do refresh. This fire events - container.refreshTabs(); - // Check events - assertEquals("event fired. listener=" + listener.toString(), 3, listener.getEventCount()); - int i=0; - assertEquals("right event", FakeFolderLifeCycleEventsListener.FOLDER_CREATED, listener.getTraces().get(i)); - assertEquals("right object", containerFacade.getNamesToInternalMap().get("f1"), listener.getEvents().get(i++).getRawModel()); - assertEquals("right event", FakeFolderLifeCycleEventsListener.FOLDER_CREATED, listener.getTraces().get(i)); - assertEquals("right object", containerFacade.getNamesToInternalMap().get("f2"), listener.getEvents().get(i++).getRawModel()); - // There is 3 events. The last one is the disposal of the folder that exist before the refresh, and replaced by - // two other folders. - assertEquals("right event", FakeFolderLifeCycleEventsListener.FOLDER_DISPOSED, listener.getTraces().get(i)); - - - // Reset the listener - listener.resetChangeCount(); - listener.resetTraces(); - - // Add a folder - containerFacade.createFolder("f1", 0, "f1", SWT.RIGHT); - container.refreshTabs(); - - // check events - assertEquals("event fired", 1, listener.getEventCount()); - i=0; - assertEquals("right event", FakeFolderLifeCycleEventsListener.FOLDER_CREATED, listener.getTraces().get(i++)); - } - - /** - * Test if the FOLDER_DISPOSED event is sent when a folder is added. - * @throws PagesModelException - */ - @Test - public void testFolderDisposedEvent() throws PagesModelException { - - SimpleSashWindowContainerTestFacade containerFacade = new SimpleSashWindowContainerTestFacade(); - // get container and contentProvider - ISashWindowsContentProvider contentProvider = containerFacade.getIContentProvider(); - SashWindowsContainer container = containerFacade.getSashContainer(); - - // Create listener and attach it - FakeFolderLifeCycleEventsListener listener = new FakeFolderLifeCycleEventsListener(); - container.getFolderLifeCycleEventProvider().addListener(listener); - - // init the container - IModelExp expr = vSash( - folder( "f1", page("p2"), page("p3"), page("p4") ), - folder( "f2", page("p1") ) - ); - containerFacade.createModel(expr); - - // Do refresh. This fire events - container.refreshTabs(); - - // Reset the listener - listener.resetChangeCount(); - listener.resetTraces(); - - // Remove page. This should remove the folder - containerFacade.removePage("p1"); - container.refreshTabs(); - - // check events - assertEquals("event fired " + listener.toString(), 1, listener.getEventCount()); - int i=0; - assertEquals("right event", FakeFolderLifeCycleEventsListener.FOLDER_DISPOSED, listener.getTraces().get(i)); - assertEquals("right object", containerFacade.getNamesToInternalMap().get("f2"), listener.getEvents().get(i++).getRawModel()); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/PageLifeCycleEventsThrownFromContainerTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/PageLifeCycleEventsThrownFromContainerTest.java deleted file mode 100644 index 7dca3c11dfc..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/PageLifeCycleEventsThrownFromContainerTest.java +++ /dev/null @@ -1,336 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.infra.core.sasheditor.internal; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.editor.IPage; -import org.eclipse.papyrus.infra.core.sasheditor.editor.MessagePartModel; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Test if the {@link SashWindowsContainer} send the events of a page lifecycle. - * Test if the page lifecycle events are correctly thrown by the {@link SashWindowsContainer} when - * page are added/removed, ... - * - * @author cedric dumoulin - * - */ -public class PageLifeCycleEventsThrownFromContainerTest /* extends AbstractPapyrusTest */{ - - protected Display display; - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - if(display == null || display.isDisposed()) { - display = Display.getCurrent(); - } - if(display == null) { - display = new Display(); - } - } - - /** - * - * @return - */ - private Display getDisplay() { - return display; - } - - /** - * Create a {@link SashWindowsContainer} to test. Initialize it with provided {@link ISashWindowsContentProvider}. - * - * @param contentProvider - * @return - */ - protected SashWindowsContainer createSashWindowsContainer(ISashWindowsContentProvider contentProvider) { - - display = getDisplay(); - Shell shell = new Shell(display); - shell.setLayout(new FillLayout()); - - // - //new ShellEditor(shell); - SashWindowsContainer sashWindowContainer = new SashWindowsContainer(); - - sashWindowContainer.setContentProvider(contentProvider); - - sashWindowContainer.createPartControl(shell); - // shell.open(); - return sashWindowContainer; - } - - /** - * Create a contentProvider. - * - * @return - */ - protected SimpleSashWindowsContentProvider createContentProvider() { - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - - // Create pages and add them to the default folder - List models = new ArrayList(); - for(int i = 0; i < 8; i++) { - IPageModel newModel = new MessagePartModel("model" + i); - contentProvider.addPage(newModel); - models.add(newModel); - } - - return contentProvider; - } - - /** - * Lookup a page by its raw model. - * - * @param container - * @param rawModel - * @return - */ - protected IPage lookupTabFolderPart(SashWindowsContainer container, Object rawModel) { - - LookupModelPageVisitor visitor = new LookupModelPageVisitor(rawModel); - container.visit(visitor); - return visitor.result(); - } - - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#addListener(org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsListener)} - * . - */ - @Ignore("TODO") - @Test - public void testAddActiveEditorChangedListener() { - //TODO - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#removeListener(org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsListener)} - * . - */ - @Ignore("TODO") - @Test - public void testRemoveActiveEditorChangedListener() { - //TODO - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageOpenedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} - * . - */ - @Test - public void testFirePageOpenedEvent() { - - // Create container and contentProvider - ISashWindowsContentProvider contentProvider = createContentProvider(); - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - - // Create listener and attach it - FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); - container.addPageLifeCycleListener(listener); - - // Do refresh. This fire events - container.refreshTabs(); - listener.resetChangeCount(); - listener.resetTraces(); - - - // Add an editor - contentProvider.addPage(new MessagePartModel("newPage")); - container.refreshTabs(); - - // check events (there is more than the 2 expected) - assertTrue("event fired", 2 <= listener.getEventCount()); - int i = 0; - assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ABOUTTOBEOPENED, listener.getTraces().get(i++)); - assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_OPENED, listener.getTraces().get(i++)); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageClosedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} - * . - */ - @Test - public void testFirePageClosedEvent() { - // Create container and contentProvider - ISashWindowsContentProvider contentProvider = createContentProvider(); - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - - // Create listener and attach it - FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); - container.addPageLifeCycleListener(listener); - - // Do refresh. This fire events - container.refreshTabs(); - - - // Add an editor - IPageModel model = new MessagePartModel("newPage"); - contentProvider.addPage(model); - container.refreshTabs(); - listener.resetChangeCount(); - listener.resetTraces(); - - IPage page1 = lookupTabFolderPart(container, model); - assertNotNull("Page found", page1); - - // Close page - contentProvider.removePage(model); - container.refreshTabs(); - - // check events (there is more than the 2 expected) - assertTrue("event fired", 2 <= listener.getEventCount()); - - assertTrue("close event fired", listener.getEvents().contains(page1)); - assertTrue("close event fired", listener.getTraces().contains(FakePageLifeCycleEventsListener.PAGE_CLOSED)); - int index = listener.getTraces().indexOf(FakePageLifeCycleEventsListener.PAGE_CLOSED); - assertEquals("right page closed", page1, listener.getEvent(index)); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageAboutToBeOpenedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} - * . - */ - @Test - public void testFirePageAboutToBeOpenedEvent() { - // Create container and contentProvider - ISashWindowsContentProvider contentProvider = createContentProvider(); - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - - // Create listener and attach it - FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); - container.addPageLifeCycleListener(listener); - - // Do refresh. This fire events - container.refreshTabs(); - listener.resetChangeCount(); - listener.resetTraces(); - - - // Add an editor - contentProvider.addPage(new MessagePartModel("newPage")); - container.refreshTabs(); - - // check events (there is more than the 2 expected) - assertTrue("event fired", 2 <= listener.getEventCount()); - int i = 0; - assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ABOUTTOBEOPENED, listener.getTraces().get(i++)); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageAboutToBeClosedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} - * . - */ - @Test - public void testFirePageAboutToBeClosedEvent() { - // no such event anymore - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageActivatedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} - * . - */ - @Test - public void testFirePageActivatedEvent() { - // Create container and contentProvider - SimpleSashWindowsContentProvider contentProvider = createContentProvider(); - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - - // Create listener and attach it - FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); - container.addPageLifeCycleListener(listener); - - container.refreshTabs(); - - - // Add two pages - IPageModel pageModel1 = new MessagePartModel("newPage1"); - IPageModel pageModel2 = new MessagePartModel("newPage2"); - contentProvider.addPage(pageModel1); - contentProvider.addPage(pageModel2); - - - // Do refresh. This fire events - container.refreshTabs(); - listener.resetChangeCount(); - listener.resetTraces(); - - // Activate page 2 (1 is already active, and activate it - // do not throw events) - IPage page1 = lookupTabFolderPart(container, pageModel2); - container.selectPage(page1); - - // check events (1 expected) - assertEquals("event fired", 1, listener.getEventCount()); - int i = 0; - assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ACTIVATED, listener.getTraces().get(i++)); - - // **************** - // Check with a move - listener.resetChangeCount(); - listener.resetTraces(); - - ITabFolderModel folderModel = contentProvider.getCurrentTabFolder(); - contentProvider.createFolder(folderModel, 0, folderModel, SWT.TOP); - - // Do refresh. This fire events - container.refreshTabs(); - // check events (there is none, as active page does not change) - // assertEquals("event fired", 3, listener.getEventCount()); - // i=0; - // assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ACTIVATED, listener.getTraces().get(i++)); - - // Create a new page - IPageModel pageModel3 = new MessagePartModel("newPage3"); - contentProvider.addPage(pageModel3); - // Do refresh. This fire events - container.refreshTabs(); - - // check events (there is more than the 2 expected) - assertEquals("event fired", 3, listener.getEventCount()); - i = 0; - assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ABOUTTOBEOPENED, listener.getTraces().get(i++)); - assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_OPENED, listener.getTraces().get(i++)); - assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ACTIVATED, listener.getTraces().get(i++)); - - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageDeactivatedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} - * . - */ - @Test - public void testFirePageDeactivatedEvent() { - // Deactivated is no sent - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashContainerEventsProviderTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashContainerEventsProviderTest.java deleted file mode 100644 index 913d54bc1e4..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashContainerEventsProviderTest.java +++ /dev/null @@ -1,186 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.infra.core.sasheditor.internal; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - - -/** - * Tests for the class {@link SashContainerEventsProvider}. - * - * @author dumoulin - * - */ -public class SashContainerEventsProviderTest /* extends AbstractPapyrusTest */{ - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#addListener(org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsListener)} - * . - */ - @Test - public void testAddActiveEditorChangedListener() { - SashContainerEventsProvider provider = new SashContainerEventsProvider(); - - FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); - provider.addListener(listener); - - // Use a null page, as it is not possible to instanciate a fake page. - PagePart page = null; - - // Send an event and check that it is received. If received, the listener is register ! - provider.firePageAboutToBeClosedEvent(page); - assertEquals("event fired", 1, listener.getEventCount()); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#removeListener(org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsListener)} - * . - */ - @Test - public void testRemoveActiveEditorChangedListener() { - SashContainerEventsProvider provider = new SashContainerEventsProvider(); - - FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); - provider.addListener(listener); - provider.removeListener(listener); - - // Use a null page, as it is not possible to instanciate a fake page. - PagePart page = null; - - // Send an event and check that it is received. If received, the listener is register ! - provider.firePageAboutToBeClosedEvent(page); - assertEquals("event not fired", 0, listener.getEventCount()); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageOpenedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} - * . - */ - @Test - public void testFirePageOpenedEvent() { - SashContainerEventsProvider provider = new SashContainerEventsProvider(); - - FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); - provider.addListener(listener); - - // Use a null page, as it is not possible to instanciate a fake page. - PagePart page = null; - - // Send an event and check that it is received. If received, the listener is register ! - provider.firePageOpenedEvent(page); - assertEquals("event fired", 1, listener.getEventCount()); - assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_OPENED, listener.getTraces().get(0)); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageClosedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} - * . - */ - @Test - public void testFirePageClosedEvent() { - SashContainerEventsProvider provider = new SashContainerEventsProvider(); - - FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); - provider.addListener(listener); - - // Use a null page, as it is not possible to instanciate a fake page. - PagePart page = null; - - // Send an event and check that it is received. If received, the listener is register ! - provider.firePageClosedEvent(page); - assertEquals("event fired", 1, listener.getEventCount()); - assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_CLOSED, listener.getTraces().get(0)); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageAboutToBeOpenedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} - * . - */ - @Test - public void testFirePageAboutToBeOpenedEvent() { - SashContainerEventsProvider provider = new SashContainerEventsProvider(); - - FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); - provider.addListener(listener); - - // Use a null page, as it is not possible to instanciate a fake page. - PagePart page = null; - - // Send an event and check that it is received. If received, the listener is register ! - provider.firePageAboutToBeOpenedEvent(page); - assertEquals("event fired", 1, listener.getEventCount()); - assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ABOUTTOBEOPENED, listener.getTraces().get(0)); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageAboutToBeClosedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} - * . - */ - @Test - public void testFirePageAboutToBeClosedEvent() { - SashContainerEventsProvider provider = new SashContainerEventsProvider(); - - FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); - provider.addListener(listener); - - // Use a null page, as it is not possible to instanciate a fake page. - PagePart page = null; - - // Send an event and check that it is received. If received, the listener is register ! - provider.firePageAboutToBeClosedEvent(page); - assertEquals("event fired", 1, listener.getEventCount()); - assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ABOUTTOBECLOSED, listener.getTraces().get(0)); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageActivatedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} - * . - */ - @Test - public void testFirePageActivatedEvent() { - SashContainerEventsProvider provider = new SashContainerEventsProvider(); - - FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); - provider.addListener(listener); - - // Use a null page, as it is not possible to instanciate a fake page. - PagePart page = null; - - // Send an event and check that it is received. If received, the listener is register ! - provider.firePageActivatedEvent(page); - assertEquals("event fired", 1, listener.getEventCount()); - assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ACTIVATED, listener.getTraces().get(0)); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageDeactivatedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} - * . - */ - @Test - public void testFirePageDeactivatedEvent() { - SashContainerEventsProvider provider = new SashContainerEventsProvider(); - - FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); - provider.addListener(listener); - - // Use a null page, as it is not possible to instanciate a fake page. - PagePart page = null; - - // Send an event and check that it is received. If received, the listener is register ! - provider.firePageDeactivatedEvent(page); - assertEquals("event fired", 1, listener.getEventCount()); - assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_DEACTIVATED, listener.getTraces().get(0)); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerDisposeCalledTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerDisposeCalledTest.java deleted file mode 100644 index 1473bde4420..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerDisposeCalledTest.java +++ /dev/null @@ -1,177 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.internal; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.FakeMultiSashPageEditor; -import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.TestTextEditor; -import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.TextEditorPartModel; -import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.junit.After; -import org.junit.Ignore; -import org.junit.Test; - -/** - * Tests to check memory leak and dispose() calls. - * - * @author Cedric Dumoulin - * - */ -public class SashWindowsContainerDisposeCalledTest /* extends AbstractPapyrusTest */{ - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - Display.getDefault().syncExec(new Runnable() { - - public void run() { - // Close all remaining opened editors - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - IWorkbenchPage page = window.getActivePage(); - page.closeAllEditors(false); - } - }); - } - - /** - * Test the call of dispose() on nestedEditor when the editor is - * closed independently - * - * * @throws PartInitException - * - * @throws Exception - */ - @Test - public void testDisposeCallOnNestedEditorRemoval() throws Exception { - // Create - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - - // Create pages and add them to the default folder - int pageCount = 3; - List models = new ArrayList(); - for(int i = 0; i < pageCount; i++) { - IPageModel newModel = new TextEditorPartModel("model" + i, true); - contentProvider.addPage(newModel); - models.add(newModel); - } - - - FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(contentProvider); - // Get the container - final SashWindowsContainer container = editor.getSashWindowsContainer(); - - // Check if nested editor creation work - IEditorPart activeNestedEditor = editor.getActiveEditor(); - assertEquals("nested editor is of right type", TestTextEditor.class, activeNestedEditor.getClass()); - - // // Close the editor by removing its model - // contentProvider.removePage(models.get(0)); - // // Refresh the container: this should close the editor - // container.refreshTabs(); - // assertNull( "No more active editor", container.getActiveEditor() ); - // // Check if dispose() is called - // ITraceRecords traces = ((TextEditorPartModel)models.get(0)).getTraceRecords(); - // assertTrue("dispose is called", traces.contains(null, "dispose")); - - // Close each container and check dispose call - for(IPageModel model : models) { - // Close the editor by removing its model - contentProvider.removePage(model); - // Refresh the container: this should close the editor - Display.getDefault().syncExec(new Runnable() { - - public void run() { - container.refreshTabs(); - } - }); - - // Check if dispose() is called - ITraceRecords traces = ((TextEditorPartModel)model).getTraceRecords(); - assertTrue("dispose is called", traces.contains(null, "dispose")); - - } - - FakeMultiSashPageEditor.closeEditor(editor); - - } - - /** - * Test if dispose can be called twice without errors. - * - * * @throws PartInitException - */ - @Ignore("TODO") - @Test - public void testCallingDisposeTwice() throws PartInitException { - //TODO - } - - /** - * Test the call of dispose() on nestedEditor when the main editor is - * closed. Normally, each nested editor should be disposed. - * - * * @throws PartInitException - */ - @Test - public void testDisposeCallOnMainEditorClose() throws PartInitException { - // Create - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - - // Create pages and add them to the default folder - int pageCount = 3; - List models = new ArrayList(); - for(int i = 0; i < pageCount; i++) { - IPageModel newModel = new TextEditorPartModel("model" + i, true); - contentProvider.addPage(newModel); - models.add(newModel); - } - - - FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(contentProvider); - - // Check if nested editor creation work - IEditorPart activeNestedEditor = editor.getActiveEditor(); - assertEquals("nested editor is of right type", TestTextEditor.class, activeNestedEditor.getClass()); - - // Close the main editor - FakeMultiSashPageEditor.closeEditor(editor); - - // for each container check dispose call - assertEquals("list of model is alive", pageCount, models.size()); - for(IPageModel model : models) { - // Check if dispose() is called - ITraceRecords traces = ((TextEditorPartModel)model).getTraceRecords(); - assertTrue("dispose nested editor is called when main editor close", traces.contains(null, "dispose")); - } - - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerMemoryLeakTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerMemoryLeakTest.java deleted file mode 100644 index 1cec9c76af5..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerMemoryLeakTest.java +++ /dev/null @@ -1,207 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.internal; - -import static org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak.MemoryLeakUtil.assertIsGarbageCollected; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.FakeMultiSashPageEditor; -import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.TestTextEditor; -import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.TextEditorPartModel; -import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.junit.After; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - -/** - * Tests to check memory leak and dispose() calls. - * - * The test do not work because the {@link TestTextEditor} don not dispose properly. We need to find - * how to dispose it properly, or use another editor. - * - * @author Cedric Dumoulin - * - */ -@Ignore -public class SashWindowsContainerMemoryLeakTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - - if (PlatformUI.isWorkbenchRunning()) { - - // Close all remaining opened editors - IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - IWorkbenchPage page = window.getActivePage(); - page.closeAllEditors(false); - } - } - - /** - * Test if calling dispose on TestEditor do not induce memory leak. - * - * * @throws PartInitException - * @throws Exception - */ - @Test - public void testDisposeOnTestEditor() throws Exception { - - TestTextEditor editor = TestTextEditor.openEditor(); - - TestTextEditor.closeEditor(editor); - // Check memory leak - WeakReference ref = new WeakReference(editor); - editor = null; - assertIsGarbageCollected(ref, 10*1000); - - - } - - - /** - * Test the call of dispose() on nestedEditor when the editor is - * closed independently - * - * * @throws PartInitException - * @throws Exception - */ - @Test - @Ignore - public void testDisposeCallOnNestedEditorRemoval() throws Exception { - // Create - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - - // Create pages and add them to the default folder - int pageCount = 3; - List models = new ArrayList(); - for(int i = 0; i < pageCount; i++) { - IPageModel newModel = new TextEditorPartModel("model" + i, true); - contentProvider.addPage(newModel); - models.add(newModel); - } - - - FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(contentProvider); - // Get the container - SashWindowsContainer container = editor.getSashWindowsContainer(); - - // Check if nested editor creation work - IEditorPart activeNestedEditor = editor.getActiveEditor(); - assertEquals("nested editor is of right type", TestTextEditor.class, activeNestedEditor.getClass()); - -// // Close the editor by removing its model -// contentProvider.removePage(models.get(0)); -// // Refresh the container: this should close the editor -// container.refreshTabs(); -// assertNull( "No more active editor", container.getActiveEditor() ); -// // Check if dispose() is called -// ITraceRecords traces = ((TextEditorPartModel)models.get(0)).getTraceRecords(); -// assertTrue("dispose is called", traces.contains(null, "dispose")); - - // Close each container and check dispose call - for(IPageModel model : models) { - // Close the editor by removing its model - contentProvider.removePage(model); - // Refresh the container: this should close the editor - container.refreshTabs(); - // Check if dispose() is called - ITraceRecords traces = ((TextEditorPartModel)model).getTraceRecords(); - assertTrue("dispose is called", traces.contains(null, "dispose")); - - } - - // Check memory leak - editor = null; - WeakReference ref = new WeakReference(activeNestedEditor); - activeNestedEditor = null; - assertIsGarbageCollected(ref, 10*1000); - - FakeMultiSashPageEditor.closeEditor(editor); - - } - - /** - * Test the call of dispose() on nestedEditor when the main editor is - * closed. Normally, each nested editor should be disposed. - * - * * @throws PartInitException - */ - @Test - @Ignore - public void testDisposeCallOnMainEditorClose() throws PartInitException { - // Create - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - - // Create pages and add them to the default folder - int pageCount = 3; - List models = new ArrayList(); - for(int i = 0; i < pageCount; i++) { - IPageModel newModel = new TextEditorPartModel("model" + i, true); - contentProvider.addPage(newModel); - models.add(newModel); - } - - - FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(contentProvider); - - // Check if nested editor creation work - IEditorPart activeNestedEditor = editor.getActiveEditor(); - assertEquals("nested editor is of right type", TestTextEditor.class, activeNestedEditor.getClass()); - - // Close the main editor - FakeMultiSashPageEditor.closeEditor(editor); - editor = null; - - // for each container check dispose call - assertEquals("list of model is alive", pageCount, models.size()); - for(IPageModel model : models) { - // Check if dispose() is called - ITraceRecords traces = ((TextEditorPartModel)model).getTraceRecords(); - assertTrue("dispose is called", traces.contains(null, "dispose")); - } - - // Check memory leak - WeakReference ref = new WeakReference(activeNestedEditor); - activeNestedEditor = null; - assertIsGarbageCollected(ref, 10*1000); - - - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerRefreshTabsTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerRefreshTabsTest.java deleted file mode 100644 index 20b2b8562a9..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerRefreshTabsTest.java +++ /dev/null @@ -1,119 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.internal; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.editor.IPage; -import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.FakeMultiSashPageEditor; -import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.TextEditorPartModel; -import org.eclipse.swt.SWT; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * Tests the correct execution of {@link SashWindowsContainer#refreshTabs()} on particular - * configuration of the model. - * - * @author Cedric Dumoulin - * - */ -public class SashWindowsContainerRefreshTabsTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - - // Close all remaining opened editors - IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - IWorkbenchPage page = window.getActivePage(); - page.closeAllEditors(false); - } - - /** - * Test that closing the last editor in a second folder correctly close the folder. - * - * * @throws PartInitException - * @throws Exception - */ - @Test - public void testCloseLastEditorInSecondFolder() throws Exception { - // Create - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - - // Create pages and add them to the default folder - int pageCount = 3; - List models = new ArrayList(); - for(int i = 0; i < pageCount; i++) { - IPageModel newModel = new TextEditorPartModel("model" + i, true); - contentProvider.addPage(newModel); - models.add(newModel); - } - - // Create the Main editor - FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(contentProvider); - // Get the container - SashWindowsContainer container = editor.getSashWindowsContainer(); - - // Index of the model of the editor to move and close - int movedEditorModelIndex = 0; - // Create a new folder by moving an editor - ITabFolderModel firstFolder = contentProvider.getCurrentTabFolder(); - contentProvider.createFolder(firstFolder, movedEditorModelIndex, firstFolder, SWT.TOP); - - // Refresh - container.refreshTabs(); - - // Check if nested editor is the moved one - IPage page = container.getActiveSashWindowsPage(); - assertEquals("nested editor is of right type", models.get(movedEditorModelIndex), page.getRawModel()); - - - // Close the editor - contentProvider.removePage(models.get(movedEditorModelIndex)); - - // Refresh - try { - container.refreshTabs(); - } catch (Exception e) { - fail("refreshTabs() work correctly"); - } - - FakeMultiSashPageEditor.closeEditor(editor); - - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerTest.java deleted file mode 100644 index fdf3c67b4d0..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerTest.java +++ /dev/null @@ -1,643 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009-2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.internal; - -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.folder; -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.page; -import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.vSash; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; - -import org.eclipse.jface.action.MenuManager; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContainerTestFacade; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; -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.IFolder; -import org.eclipse.papyrus.infra.core.sasheditor.editor.IPage; -import org.eclipse.papyrus.infra.core.sasheditor.editor.IPageVisitor; -import org.eclipse.papyrus.infra.core.sasheditor.editor.MessagePartModel; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; -import org.eclipse.papyrus.infra.core.sasheditor.utils.FakeObservableListener; -import org.eclipse.papyrus.infra.core.sasheditor.utils.IObservableList; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Run as normal test. - * - * @author cedric dumoulin - * - */ -public class SashWindowsContainerTest /* extends AbstractPapyrusTest */{ - - - protected Display display; - - /** - * Constructor. - * - * @param name - */ - public SashWindowsContainerTest() { - } - - /** - * @see junit.framework.TestCase#setUp() - * @throws java.lang.Exception - * - */ - @Before - public void setUp() throws Exception { - display = Display.getCurrent(); - if(display == null) { - display = new Display(); - } - } - - /** - * Create a {@link SashWindowsContainer} to test. Initialize it with provided {@link ISashWindowsContentProvider}. - * - * @param contentProvider - * @return - */ - protected SashWindowsContainer createSashWindowsContainer(ISashWindowsContentProvider contentProvider) { - Shell shell = new Shell(display); - shell.setLayout(new FillLayout()); - - // - //new ShellEditor(shell); - SashWindowsContainer sashWindowContainer = new SashWindowsContainer(); - - sashWindowContainer.setContentProvider(contentProvider); - - sashWindowContainer.createPartControl(shell); - // shell.open(); - return sashWindowContainer; - } - - /** - * Create a contentProvider. - * - * @return - */ - protected ISashWindowsContentProvider createContentProvider() { - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - - // Create pages and add them to the default folder - List models = new ArrayList(); - for(int i = 0; i < 8; i++) { - IPageModel newModel = new MessagePartModel("model" + i); - contentProvider.addPage(newModel); - models.add(newModel); - } - - return contentProvider; - } - - /** - * Test the method on a model with several folders and page. - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#getActiveEditor()}. - */ - @Test - public void testGetActiveEditor() { - // Create - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - - // Create pages and add them to the default folder - List models = new ArrayList(); - for(int i = 0; i < 2; i++) { - IPageModel newModel = new MessagePartModel("model" + i); - contentProvider.addPage(newModel); - models.add(newModel); - } - - // Create new folder - ITabFolderModel folder = contentProvider.getCurrentTabFolder(); - contentProvider.createFolder(folder, 1, folder, SWT.TOP); - - // Get the active editor - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - IPage page = container.getActiveSashWindowsPage(); - assertNotNull("Page exist", page); - } - - /** - * Test the method on a model with several folders and page. - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#getActiveEditor()}. - * Use new implementation to populate contentProvider - * - * @throws PagesModelException - */ - @Test - public void testGetActiveEditor2() throws PagesModelException { - - // Create populated content provider - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); - - // define how to populate contentProvider - IModelExp expr = vSash(folder("f1", page("p11"), page("p12")), folder("f2", page("p21"))); - // Try to create the model - helper.createModel(expr); - - - // Get the active editor - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - IPage page = container.getActiveSashWindowsPage(); - assertNotNull("Page exist", page); - } - - /** - * Test the method on a model with several folders and page. - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#getActiveEditor()}. - */ - @Test - public void testGetVisiblePages() { - // Create - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - - // Create pages and add them to the default folder - List models = new ArrayList(); - for(int i = 0; i < 2; i++) { - IPageModel newModel = new MessagePartModel("model" + i); - contentProvider.addPage(newModel); - models.add(newModel); - } - - // Create new folder - ITabFolderModel folder = contentProvider.getCurrentTabFolder(); - contentProvider.createFolder(folder, 1, folder, SWT.TOP); - // Add pages - List modelsInFolder2 = new ArrayList(); - for(int i = 0; i < 2; i++) { - IPageModel newModel = new MessagePartModel("modelInFolder2" + i); - contentProvider.addPage(newModel); - modelsInFolder2.add(newModel); - } - - // Build a list of expected visible models - List expectedVisibleModel = new ArrayList(); - expectedVisibleModel.add(models.get(models.size() - 1)); - expectedVisibleModel.add(modelsInFolder2.get(models.size() - 1)); - - // Get the active editor - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - List pages = container.getVisiblePages(); - - assertEquals("2 pages visible", 2, pages.size()); - assertTrue("contains active from folder 1", expectedVisibleModel.contains(pages.get(0).getRawModel())); - assertTrue("contains active from folder 1", expectedVisibleModel.contains(pages.get(1).getRawModel())); - // assertNotNull("Page exist", page); - } - - /** - * Test the method on a model with several folders and page. - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#getActiveEditor()}. - * Use new implementation to populate contentProvider - * - * @throws PagesModelException - */ - @Test - public void testGetVisiblePages2() throws PagesModelException { - // Create populated content provider - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); - - // define how to populate contentProvider - IModelExp expr = vSash(folder("f1", page("p11"), page("p12")), folder("f2", page("p21"), page("p22"))); - // Try to create the model - helper.createModel(expr); - // Get the references - Map models = helper.queryModel(expr); - - - // Create the container - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - // Get visible pages - List pages = container.getVisiblePages(); - // Build a list of raw models - List visibleModels = new ArrayList(); - for(IPage page : pages) { - visibleModels.add(page.getRawModel()); - } - - assertEquals("2 pages visible", 2, pages.size()); - assertTrue("contains active page from folder 1", visibleModels.contains(models.get("p11"))); - assertTrue("contains active page from folder 2", visibleModels.contains(models.get("p22"))); - - // Check orders - assertEquals(models.get("p11"), pages.get(0).getRawModel()); - assertEquals(models.get("p22"), pages.get(1).getRawModel()); - } - - /** - * Test the method on a model with only one folder. - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#getActiveEditor()}. - * Use new implementation to populate contentProvider - * - * @throws PagesModelException - */ - @Test - public void testGetVisiblePagesOneFoler() throws PagesModelException { - // Create populated content provider - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); - - // define how to populate contentProvider - IModelExp expr = folder("f1", page("p11"), page("p12"), page("p13")); - // Try to create the model - helper.createModel(expr); - // Get the references - Map models = helper.queryModel(expr); - - - // Create the container - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - // Get visible pages - List pages = container.getVisiblePages(); - // Build a list of raw models - List visibleModels = new ArrayList(); - for(IPage page : pages) { - visibleModels.add(page.getRawModel()); - } - - assertEquals("1 pages visible", 1, pages.size()); - assertTrue("contains active page from folder 1", visibleModels.contains(models.get("p11"))); - - // Check orders - assertEquals(models.get("p11"), pages.get(0).getRawModel()); - } - - /** - * Test the method on a model with no pages. - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#getActiveEditor()}. - */ - @Test - public void testGetActiveEditorNoPage() { - // Create - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - - - // Get the active editor - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - IPage page = container.getActiveSashWindowsPage(); - assertNull("No Page exist", page); - } - - /** - * Test the method on a model with several folders and page. - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#selectPage(IPage)}. - * Use new implementation to populate contentProvider - * - * @throws PagesModelException - */ - @Test - public void testSelectPage() throws PagesModelException { - // Create populated content provider - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); - - // define how to populate contentProvider - IModelExp expr = vSash(folder("f1", page("p11"), page("p12"), page("p13"), page("p14")), folder("f2", page("p21"), page("p22"))); - // Try to create the model - helper.createModel(expr); - // Get the references - Map models = helper.queryModel(expr); - - - // Create the container - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - - // Check if we have an active page - assertNotNull("active page set", container.getActiveSashWindowsPage()); - - // Try to set active page - IPage p12 = container.lookupModelPage(models.get("p12")); - container.selectPage(p12); - assertEquals("page selected", p12, container.getActiveSashWindowsPage()); - - // Try to set active page - IPage p22 = container.lookupModelPage(models.get("p22")); - container.selectPage(p22); - assertEquals("page selected", p22, container.getActiveSashWindowsPage()); - - // Try to set active page - IPage p11 = container.lookupModelPage(models.get("p11")); - container.selectPage(p11); - assertEquals("page selected", p11, container.getActiveSashWindowsPage()); - } - - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#refreshTabs()}. - */ - @Test - public void testRefreshTabs() { - - ISashWindowsContentProvider contentProvider = createContentProvider(); - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - - container.refreshTabs(); - assertNotNull("container is set", container); - - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#refreshTabs()}. - */ - @Test - public void testRefreshTabs2() { - - // Test 2 folders, one tab each. Then supress one tabs. - // 1 folder with one tab should remain. - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - - // Create pages and add them to the default folder - List models = new ArrayList(); - for(int i = 0; i < 2; i++) { - IPageModel newModel = new MessagePartModel("model" + i); - contentProvider.addPage(newModel); - models.add(newModel); - } - - // Create new folder - ITabFolderModel folder = contentProvider.getCurrentTabFolder(); - contentProvider.createFolder(folder, 1, folder, SWT.TOP); - - // Create the container - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - container.refreshTabs(); - assertNotNull("container is set", container); - - } - - /** - * Test method for {@link SashWindowsContainer#visit(org.eclipse.papyrus.infra.core.sasheditor.editor.IPageVisitor)} - */ - @Test - public void testVisit() { - // Create - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - - // Create pages and add them to the default folder - List models = new ArrayList(); - for(int i = 0; i < 2; i++) { - IPageModel newModel = new MessagePartModel("model" + i); - contentProvider.addPage(newModel); - models.add(newModel); - } - - // Create new folder - ITabFolderModel folder = contentProvider.getCurrentTabFolder(); - contentProvider.createFolder(folder, 1, folder, SWT.TOP); - - // Get the active editor - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - - CollectRawModelVisitor pageVisitor = new CollectRawModelVisitor(); - container.visit(pageVisitor); - - // Check each elements - Collection results = pageVisitor.collected; - assertEquals("list are of same size", models.size(), results.size()); - for(Object model : models) { - assertTrue("model is in the collected list", results.contains(model)); - } - } - - protected class CollectRawModelVisitor implements IPageVisitor { - - Collection collected = new ArrayList(); - - public void accept(IComponentPage page) { - collected.add(page.getRawModel()); - } - - public void accept(IEditorPage page) { - collected.add(page.getRawModel()); - } - } - - /** - * Test the lookup of a page by its raw model - * Test method for {@link SashWindowsContainer#lookupModelPage(Object)} - */ - @Test - public void testlookupModelPage() { - // Create - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - - // Create pages and add them to the default folder - List models = new ArrayList(); - for(int i = 0; i < 2; i++) { - IPageModel newModel = new MessagePartModel("model" + i); - contentProvider.addPage(newModel); - models.add(newModel); - } - - // Create new folder - ITabFolderModel folder = contentProvider.getCurrentTabFolder(); - contentProvider.createFolder(folder, 1, folder, SWT.TOP); - - // Get the active editor - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - - Object model = models.get(1); - IPage foundPage = container.lookupModelPage(model); - assertEquals("Corresponding page is found", foundPage.getRawModel(), model); - } - - /** - * Test method for {@link SashWindowsContainer#setFolderTabMenuManager(MenuManager)} - */ - @Test - public void testSetFolderTabMenuManager_MenuManager() { - // Create - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - - // Create pages and add them to the default folder - List models = new ArrayList(); - for(int i = 0; i < 2; i++) { - IPageModel newModel = new MessagePartModel("model" + i); - contentProvider.addPage(newModel); - models.add(newModel); - } - - // Create new folders - ITabFolderModel referenceFolder = contentProvider.getCurrentTabFolder(); - ITabFolderModel folder1 = contentProvider.createFolder(referenceFolder, SWT.TOP); - ITabFolderModel folder2 = contentProvider.createFolder(referenceFolder, SWT.DOWN); - ITabFolderModel folder3 = contentProvider.createFolder(referenceFolder, SWT.LEFT); - - // Create SashWindowsContainer - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - // Set a MenuManager - MenuManager menuManager = new MenuManager(); - container.setFolderTabMenuManager(menuManager); - - // Test if the menu has been set in already created folders. - TabFolderPart folderPart = lookupTabFolderPart(container, referenceFolder); - assertNotNull("menu exist", folderPart.getControl().getMenu()); - - folderPart = lookupTabFolderPart(container, folder1); - assertNotNull("menu exist", folderPart.getControl().getMenu()); - - folderPart = lookupTabFolderPart(container, folder2); - assertNotNull("menu exist", folderPart.getControl().getMenu()); - - folderPart = lookupTabFolderPart(container, folder3); - assertNotNull("menu exist", folderPart.getControl().getMenu()); - - - // Now create another tab, refresh the container in order that the part is created, - // ant test it - ITabFolderModel folder4 = contentProvider.createFolder(referenceFolder, SWT.RIGHT); - container.refreshTabs(); - - folderPart = lookupTabFolderPart(container, folder4); - assertNotNull("menu exist", folderPart.getControl().getMenu()); - - } - - @Ignore("TODO") - @Test - public void testSelectPagePageId() { - //TODO - } - - protected TabFolderPart lookupTabFolderPart(SashWindowsContainer container, Object rawModel) { - - LookupFolderPartByRawModelVisitor visitor = new LookupFolderPartByRawModelVisitor(rawModel); - container.visit(visitor); - return visitor.result(); - } - - /** - * Test If the FolderList is properly populated. - * - * * @throws PagesModelException - */ - @Test - public void testFolderList() throws PagesModelException { - // Create populated content provider - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); - - // define how to populate contentProvider - IModelExp expr = vSash(folder("f1", page("p11"), page("p12")), folder("f2", page("p21"), page("p22"))); - // Try to create the model - helper.createModel(expr); - // Get the references - Map models = helper.queryModel(expr); - - // Create the container - SashWindowsContainer container = createSashWindowsContainer(contentProvider); - - // Check the folder list - IObservableList list = container.getIFolderList(); - // Listener on the list - FakeObservableListener listener = new FakeObservableListener(); - list.addListener(listener); - - // Check list before - assertNotNull("List exist", list); - assertEquals("list size", 2, list.size()); - - // create a folder - ITabFolderModel folder = (ITabFolderModel)models.get("f2"); - assertNotNull("folder found", folder); - contentProvider.createFolder(folder, 0, folder, SWT.UP); - // Refresh tabs, so that tabfolder is created. - container.refreshTabs(); - - // Check if the list contains the new folder - assertEquals("list size", 3, list.size()); - // check event fired - assertNotNull("event sent", listener.getLastAddEvents()); - // assertEquals( "event sent", folder, listener.getLastAddEvents().getRawModel() ); - - } - - /** - * Test If the FolderList is properly populated. - * - * * @throws PagesModelException - */ - @Test - public void testFolderList2() throws PagesModelException { - - SimpleSashWindowContainerTestFacade containerFacade = new SimpleSashWindowContainerTestFacade(); - - // define how to populate contentProvider - IModelExp expr = vSash(folder("f1", page("p11"), page("p12")), folder("f2", page("p21"), page("p22"))); - // Try to create the model - containerFacade.createModel(expr); - - // Create the container - SashWindowsContainer container = containerFacade.getSashContainer(); - - // Refresh container, so that pages are created. - container.refreshTabs(); - - // Check the folder list - IObservableList list = container.getIFolderList(); - // Listener on the list - FakeObservableListener listener = new FakeObservableListener(); - list.addListener(listener); - - // Check list before - assertNotNull("List exist", list); - assertEquals("list size", 2, list.size()); - - // create a folder - containerFacade.createFolder("f2", 0, "f2", SWT.UP); - // Refresh tabs, so that tabfolder is created. - container.refreshTabs(); - - // build expr corresponding to new configuration - IModelExp newExpr = vSash(folder("f1", page("p11"), page("p12")), vSash(folder("f3", page("p21")), folder("f2", page("p22")))); - // Reset facade names to correspond to new configuration. - containerFacade.resetNamesContext(newExpr); - ITabFolderModel folder = containerFacade.getITabFolderModel("f3"); - - // Check if the list contains the new folder - assertEquals("list size", 3, list.size()); - - - // check event fired - assertNotNull("event sent", listener.getLastAddEvents()); - assertEquals("event sent", folder, listener.getLastAddEvents().getRawModel()); - - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/TabFolderListManagerTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/TabFolderListManagerTest.java deleted file mode 100644 index 227aa9c6949..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/TabFolderListManagerTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.internal; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - - -/** - * Tests for the {@link SashContainerFolderEventsProvider} class. - * @author cedric dumoulin - * - */ -public class TabFolderListManagerTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - /** - * Test addition of a folder. Check if the folder is added to the list, and event added. - * - */ - @Test - public void testFolderAdded() { - - // Create listManager and folder event provider - TabFolderListManager listManager = new TabFolderListManager(); - SashContainerFolderEventsProvider folderEventProvider = new SashContainerFolderEventsProvider(); - folderEventProvider.addListener(listManager); - - // fire folder added event - TabFolderPart folder1= new FakeTabFolderPart(); - folderEventProvider.fireFolderCreatedEvent(folder1); - - // Check the list - assertTrue( "folder added", listManager.getFolderList().contains(folder1) ); - - } - - /** - * Test addition of a folder. Check if the folder is added to the list, and event added. - */ - @Test - public void testFolderRemoved() { - // Create listManager and folder event provider - TabFolderListManager listManager = new TabFolderListManager(); - SashContainerFolderEventsProvider folderEventProvider = new SashContainerFolderEventsProvider(); - folderEventProvider.addListener(listManager); - - // fire folder added event - TabFolderPart folder1= new FakeTabFolderPart(); - folderEventProvider.fireFolderCreatedEvent(folder1); - - TabFolderPart folder2= new FakeTabFolderPart(); - folderEventProvider.fireFolderCreatedEvent(folder2); - - // Check the list - assertTrue( "folder added", listManager.getFolderList().contains(folder1) ); - assertTrue( "folder added", listManager.getFolderList().contains(folder2) ); - - // remove the folder - folderEventProvider.fireFolderDisposedEvent(folder1); - assertFalse( "folder removed", listManager.getFolderList().contains(folder1) ); - assertTrue( "folder added", listManager.getFolderList().contains(folder2) ); - - - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/AbstractSash.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/AbstractSash.java deleted file mode 100644 index 0d1cfcd8c1c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/AbstractSash.java +++ /dev/null @@ -1,95 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - - -/** - * Base class for structure representing sash in Checker - * @author cedric dumoulin - * - */ -public abstract class AbstractSash extends PanelTerm { - - protected PanelTerm leftup; - protected PanelTerm rightdown; - - /** - * Constructor. - * - */ - public AbstractSash(PanelTerm left, PanelTerm right) { - this.leftup = left; - this.rightdown = right; - } - - /** - * Constructor. - * - * @param name - * @param up - * @param down - */ - public AbstractSash(String name, PanelTerm left, PanelTerm right) { - super(name); - this.leftup = left; - this.rightdown = right; - } - - /** - * @return the leftup - */ - public PanelTerm getLeftup() { - return leftup; - } - - /** - * @return the rightdown - */ - public PanelTerm getRightdown() { - return rightdown; - } - - /** - * - * @param visitor - * @throws PagesModelException - */ - abstract public void accept(IPagesModelVisitor visitor, M modelObject) throws PagesModelException ; - - /** - * @return The name used in toString - */ - protected abstract String getStringName(); - - /** - * @see java.lang.Object#toString() - * - * @return - */ - @Override - public String toString() { - - StringBuffer buff = new StringBuffer(getStringName()); - - buff.append("("); - buff.append(leftup.toString()); - buff.append(", "); - buff.append(rightdown.toString()); - buff.append(")"); - - return buff.toString(); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/BadNameException.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/BadNameException.java deleted file mode 100644 index 3c5c56528aa..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/BadNameException.java +++ /dev/null @@ -1,82 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - - - -/** - * @author cedric dumoulin - * - */ -public class BadNameException extends PagesModelException { - - /** - * - */ - private static final long serialVersionUID = 1L; - - /** - * Constructor. - * - */ - public BadNameException() { - // TODO Auto-generated constructor stub - } - - /** - * Constructor. - * - * @param arg0 - */ - public BadNameException(String arg0) { - super(arg0); - // TODO Auto-generated constructor stub - } - - /** - * Constructor. - * - * @param arg0 - */ - public BadNameException(Throwable arg0) { - super(arg0); - // TODO Auto-generated constructor stub - } - - /** - * Constructor. - * - * @param arg0 - * @param arg1 - */ - public BadNameException(String arg0, Throwable arg1) { - super(arg0, arg1); - // TODO Auto-generated constructor stub - } - - /** - * Constructor. - * - * @param arg0 - * @param arg1 - * @param arg2 - * @param arg3 - */ - public BadNameException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { - super(arg0, arg1, arg2, arg3); - // TODO Auto-generated constructor stub - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Folder.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Folder.java deleted file mode 100644 index abcae95d7db..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Folder.java +++ /dev/null @@ -1,90 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - -import java.util.Arrays; -import java.util.List; - -/** - * This represent a Folder in the Checker query. - * - * @author cedric dumoulin - */ -public class Folder extends PanelTerm implements IModelObject { - - protected List pages; - - /** - * Constructor. - * - */ - public Folder(Page ... pages) { - this.pages = Arrays.asList(pages); - } - - /** - * Constructor. - * - */ - public Folder(String name, Page ... pages) { - super(name); - this.pages = Arrays.asList(pages); - } - - /** - * @return the pages - */ - public List getPages() { - return pages; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.IModelObject.sashmodel.query.IQueryTerm#accept(IPagesModelVisitor, EObject) - * - * @param visitor - * @throws PagesModelException - */ - public void accept(IPagesModelVisitor visitor, M modelObject) throws PagesModelException { - - visitor.walk(this, modelObject); - } - - /** - * @see java.lang.Object#toString() - * - * @return - */ - @Override - public String toString() { - - StringBuffer buff = new StringBuffer("Folder("); - - if( getName() != null ) { - buff.append(getName()).append(", "); - } - - for(Page page : pages ) { - buff.append(page.toString()).append(", "); - } - // Remove extra , - int length = buff.length(); - if(buff.charAt(length-1) == ' ') { - buff.delete(length-2, length ); - } - buff.append(")"); - - return buff.toString(); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/HSash.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/HSash.java deleted file mode 100644 index cbaedf11103..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/HSash.java +++ /dev/null @@ -1,66 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - - -/** - * @author dumoulin - * - */ -public class HSash extends AbstractSash { - - /** - * Constructor. - * - * @param leftup - * @param rightdown - */ - public HSash(PanelTerm up, PanelTerm down) { - super(up, down); - } - - /** - * Constructor. - * - * @param leftup - * @param rightdown - */ - public HSash(String name, PanelTerm up, PanelTerm down) { - super(name, up, down); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.IModelObject.sashmodel.query.IQueryTerm#accept(IPagesModelVisitor, EObject) - * - * @param visitor - * @throws PagesModelException - */ - public void accept(IPagesModelVisitor visitor, M modelObject) throws PagesModelException { - - visitor.walk(this, modelObject); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.AbstractSash#getStringName() - * - * @return - */ - @Override - protected String getStringName() { - return "HSash"; - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelExp.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelExp.java deleted file mode 100644 index 83654ea81f8..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelExp.java +++ /dev/null @@ -1,28 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - -/** - * A Model Expression represent an expression used to describe a PagesModel. - * Term implementing this interface can be used as starting point of expression. - *
- * Following classses are expressions: {@link PanelTerm}, {@link WindowTerm}, {@link PagesModel}. - * - * @author cedric dumoulin - * TODO Rename to IModelExp - */ -public interface IModelExp extends IModelObject { - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelObject.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelObject.java deleted file mode 100644 index e16bfd38324..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelObject.java +++ /dev/null @@ -1,38 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - - -/** - * Common ancestor of all object in the Model. - * All object that can be used in a query should implement this interface. - * - * @author cedric dumoulin - */ -public interface IModelObject { - - /** - * Visit the query. - * @param visitor - * @throws PagesModelException - */ - public void accept(IPagesModelVisitor visitor, M panel) throws PagesModelException; - - /** - * Get the name associated to the query part. - * Can return null; - */ - public String getName(); -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IPagesModelVisitor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IPagesModelVisitor.java deleted file mode 100644 index 3d9ac3b46d1..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IPagesModelVisitor.java +++ /dev/null @@ -1,68 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - -/** - * Visitor used to visit pagemodel structure. - * - * @author cedric dumoulin - * - * @param M Type of the models provided to visit() and walk(). This is the common - * ancestor of all types of the walked model. - * - */ -public interface IPagesModelVisitor { - - /** - * If true, parent are visited before children. - * If false, parent are visited after children. - * @return - */ - public boolean isVisitingParentFirst(); - - /** - * Walk the node and its children. Call visit visit method appropiatly. - * This method encapsulate the navigation between nodes. - * - * @param windowTerm The term to navigate - * @param windowModel the model that maybe correspond to the term. - * @throws PagesModelException - * - */ - public void walk( SashPagesModel windowTerm, M windowModel ) throws PagesModelException; - public void walk( WindowTerm windowTerm, M windowModel ) throws PagesModelException; - public void walk( Folder folder, M folderModel ) throws PagesModelException; - - public void walk(HSash sash, M sashModel) throws PagesModelException; - public void walk(VSash sash, M sashModel) throws PagesModelException; - - public void walk(Page page, M pageModel) throws PagesModelException; - - - /** - * Visit the corresponding term. - * @param windowTerm The term to visit - * @param windowModel The corresponding model found while walking the expr. - */ -// public void visit( SashPagesModel windowTerm, M windowModel ) throws PagesModelException; -// public void visit( WindowTerm windowTerm, M windowModel ) throws PagesModelException; -// public void visit( Folder folder, M folderModel ) throws PagesModelException; -// -// public void visit(HSash sash, M sashModel) throws PagesModelException; -// public void visit(VSash sash, M sashModel) throws PagesModelException; -// -// public void visit(Page page, M pageModel) throws PagesModelException; - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NoMatchException.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NoMatchException.java deleted file mode 100644 index 3a3fcc211f7..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NoMatchException.java +++ /dev/null @@ -1,77 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - -/** - * Exception thrown when a query part does not match a modelpart. - * - * @author cedric dumoulin - * - */ -public class NoMatchException extends PagesModelException { - - /** - * - */ - private static final long serialVersionUID = 1L; - - /** - * Constructor. - * - */ - public NoMatchException() { - } - - /** - * Constructor. - * - * @param arg0 - */ - public NoMatchException(String arg0) { - super(arg0); - } - - /** - * Constructor. - * - * @param arg0 - */ - public NoMatchException(Throwable arg0) { - super(arg0); - } - - /** - * Constructor. - * - * @param arg0 - * @param arg1 - */ - public NoMatchException(String arg0, Throwable arg1) { - super(arg0, arg1); - } - - /** - * Constructor. - * - * @param arg0 - * @param arg1 - * @param arg2 - * @param arg3 - */ - public NoMatchException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { - super(arg0, arg1, arg2, arg3); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NotFoundException.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NotFoundException.java deleted file mode 100644 index eeca81273f3..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NotFoundException.java +++ /dev/null @@ -1,82 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - - -/** - * @author cedric dumoulin - * - */ -public class NotFoundException extends PagesModelException { - - /** - * - */ - private static final long serialVersionUID = 1L; - - /** - * Constructor. - * - */ - public NotFoundException() { - super(); - // TODO Auto-generated constructor stub - } - - /** - * Constructor. - * - * @param arg0 - * @param arg1 - * @param arg2 - * @param arg3 - */ - public NotFoundException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { - super(arg0, arg1, arg2, arg3); - // TODO Auto-generated constructor stub - } - - /** - * Constructor. - * - * @param arg0 - * @param arg1 - */ - public NotFoundException(String arg0, Throwable arg1) { - super(arg0, arg1); - // TODO Auto-generated constructor stub - } - - /** - * Constructor. - * - * @param arg0 - */ - public NotFoundException(String arg0) { - super(arg0); - // TODO Auto-generated constructor stub - } - - /** - * Constructor. - * - * @param arg0 - */ - public NotFoundException(Throwable arg0) { - super(arg0); - // TODO Auto-generated constructor stub - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Page.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Page.java deleted file mode 100644 index 5bd2fa904bb..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Page.java +++ /dev/null @@ -1,116 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - - -/** - * This represent a page in the Checker query. - * - * @author cedric dumoulin - * - */ -public class Page implements IModelObject { - - protected Object identifier; - - protected String name; - - /** To generate automatic name */ - static int count=1; - - /** - * Constructor. - * - */ - public Page() { - // Automatic name generation - this( "page"+count++); - } - - /** - * Constructor. - * - * @param identifier - */ - public Page(Object identifier) { - this.identifier = identifier; - this.name = identifier.toString(); - } - - /** - * Constructor. - * - * @param name - * @param identifier - */ - public Page(String name) { - this.name = name; - this.identifier = name; - } - - /** - * Constructor. - * - * @param name - * @param identifier - */ - public Page(String name, Object identifier) { - this.name = name; - this.identifier = identifier; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.IModelObject.sashmodel.query.IQueryTerm#accept(IPagesModelVisitor, EObject) - * - * @param visitor - * @throws PagesModelException - */ - public void accept(IPagesModelVisitor visitor, M modelObject) throws PagesModelException { - - visitor.walk(this, modelObject); - } - - /** - * @return the identifier - */ - public Object getIdentifier() { - return identifier; - } - - /** - * @param identifier the identifier to set - */ - public void setIdentifier(Object identifier) { - this.identifier = identifier; - } - - /** - * @see java.lang.Object#toString() - * - * @return - */ - @Override - public String toString() { - - return "Page()"; - } - - /** - * @return the name - */ - public String getName() { - return name; - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PagesModelException.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PagesModelException.java deleted file mode 100644 index 912da20781e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PagesModelException.java +++ /dev/null @@ -1,78 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - -/** - * Root Exception of the pagesmodel package - * - * @author cedric dumoulin - * - * TODO Rename to PagesModelException - */ -public class PagesModelException extends Exception { - - /** - * - */ - private static final long serialVersionUID = 1L; - - /** - * Constructor. - * - */ - public PagesModelException() { - } - - /** - * Constructor. - * - * @param arg0 - */ - public PagesModelException(String arg0) { - super(arg0); - } - - /** - * Constructor. - * - * @param arg0 - */ - public PagesModelException(Throwable arg0) { - super(arg0); - } - - /** - * Constructor. - * - * @param arg0 - * @param arg1 - */ - public PagesModelException(String arg0, Throwable arg1) { - super(arg0, arg1); - } - - /** - * Constructor. - * - * @param arg0 - * @param arg1 - * @param arg2 - * @param arg3 - */ - public PagesModelException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { - super(arg0, arg1);//, arg2, arg3); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PanelTerm.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PanelTerm.java deleted file mode 100644 index bd1d79b05bf..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PanelTerm.java +++ /dev/null @@ -1,74 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - - -/** - * Common ancestor of Panel (Folder and Sash) in queries structure. - *
- * This class can also be used a starting point of query expression (and so Folder, VSash and HSash). - * - * @author cedric dumoulin - * - */ -public abstract class PanelTerm implements IModelExp { - - protected String name; - - - /** - * Constructor. - * - */ - public PanelTerm() { - } - - /** - * Constructor. - * - * @param name - */ - public PanelTerm(String name) { - this.name = name; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.IModelObject.sashmodel.query.IQueryTerm#accept(org.eclipse.papyrus.infra.core.sasheditor.IPagesModelVisitor.sashmodel.query.IQueryVisitor, org.eclipse.emf.ecore.EObject) - * - * @param visitor - * @param panel - * @throws PagesModelException - */ - public void accept(IPagesModelVisitor visitor, M panel) - throws PagesModelException { - // TODO Auto-generated method stub - - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @param name the name to set - */ - public void setName(String name) { - this.name = name; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModel.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModel.java deleted file mode 100644 index a08aa1521f6..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModel.java +++ /dev/null @@ -1,103 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - -import java.util.ArrayList; -import java.util.List; - -/** - * Sash Pages model allow to create a models of the pages represented by the {@link SashWindowsContainer}. - * Such model can then be used to create corresponding pages and intermediate artifact in a {@link ISashWindowsContentProvider}, - * or to check the structure, .... - * - *
- * The model contains windows. Actually, the {@link SashWindowsContainer} only support one window. - * - * @author cedric dumoulin - * - */ -public class SashPagesModel implements IModelExp { - - /** - * A window have only one panel. - */ - protected List windows = new ArrayList(); - - protected String name; - - /** - * Constructor. - * - * @param panel - */ - public SashPagesModel(WindowTerm window) { - this.windows.add(window); - } - - /** - * Constructor. - * - * @param name - * @param panel - */ - public SashPagesModel(String name, WindowTerm window) { - this.name = name; - this.windows.add(window); - } - - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.IModelObject.sashmodel.query.IQueryTerm#accept(org.eclipse.papyrus.infra.core.sasheditor.IPagesModelVisitor.sashmodel.query.IQueryVisitor, org.eclipse.emf.ecore.EObject) - * - * @param visitor - * @param panel - * @throws PagesModelException - */ - public void accept(IPagesModelVisitor visitor, M model) throws PagesModelException { - - visitor.walk(this, model); - - } - - - /** - * @return the panel - * @throws PagesModelException - */ - public WindowTerm getFirstWindow() throws PagesModelException { - if( windows.size() >0) { - return windows.get(0); - } - - // no elements - throw new PagesModelException("No window found in model."); - } - - /** - * @return the panel - */ - public List getWindows() { - return windows; - } - - - /** - * @return the name - */ - public String getName() { - return name; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModelFactory.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModelFactory.java deleted file mode 100644 index c29154cafd3..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModelFactory.java +++ /dev/null @@ -1,98 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - - -/** - * This class provides a set of static constructor helping in writing model. - *
- * Examples: - *
    - *
  • PanelTerm query = folder("a", page(), page() );
  • - *
  • query = hSash( folder( page("p1"), page() ), vSash("s2", folder( page() ), folder( page() )) );
  • - *
  • PanelTerm query = hSash( folder("f1", page("p1"), page("p2"), page("p3") ), folder("f2", page("p4") ) );
  • - *
  • - *
- * - * @author cedric dumoulin - * - */ -public class SashPagesModelFactory { - - /** - * Static constructor for {@link Page}. - * @return - */ - static public Page page() { - return new Page(); - } - - /** - * Static constructor for {@link Page}. - * @return - */ - static public Page page(String name) { - return new Page(name); - } - - /** - * Static constructor for {@link Folder}. - * @return - */ - static public Folder folder( Page ...pages ) { - return new Folder(pages); - } - - /** - * Static constructor for {@link Folder}. - * @return - */ - static public Folder folder( String name, Page ...pages ) { - return new Folder(name, pages); - } - - /** - * Static constructor for {@link VSash}. - * @return - */ - static public VSash vSash( String name, PanelTerm up, PanelTerm down) { - return new VSash(name, up, down); - } - - /** - * Static constructor for {@link VSash}. - * @return - */ - static public VSash vSash( PanelTerm up, PanelTerm down) { - return new VSash(up, down); - } - - /** - * Static constructor for {@link HSash}. - * @return - */ - static public HSash hSash( String name, PanelTerm left, PanelTerm right) { - return new HSash(name, left, right); - } - - /** - * Static constructor for {@link HSash}. - * @return - */ - static public HSash hSash( PanelTerm left, PanelTerm right) { - return new HSash(left, right); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/VSash.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/VSash.java deleted file mode 100644 index f3e020c216b..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/VSash.java +++ /dev/null @@ -1,66 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - - -/** - * Class for structure representing vertical sash in Checker - * - * @author dumoulin - * - */ -public class VSash extends AbstractSash { - - /** - * Constructor. - * - * @param leftup - * @param rightdown - */ - public VSash(PanelTerm left, PanelTerm right) { - super(left, right); - } - - /** - * Constructor. - * - * @param leftup - * @param rightdown - */ - public VSash(String name, PanelTerm left, PanelTerm right) { - super(name, left, right); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.IModelObject.sashmodel.query.IQueryTerm#accept(IPagesModelVisitor, EObject) - * - * @param visitor - * @throws PagesModelException - */ - public void accept(IPagesModelVisitor visitor, M modelObject) throws PagesModelException { - visitor.walk(this, modelObject); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.AbstractSash#getStringName() - * - * @return - */ - @Override - protected String getStringName() { - return "VSash"; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/WindowTerm.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/WindowTerm.java deleted file mode 100644 index 27399c58c99..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/WindowTerm.java +++ /dev/null @@ -1,83 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; - - -/** - * A term representing a Window in the query - * - * @author cedric dumoulin - * - */ -public class WindowTerm implements IModelExp { - - /** - * A window have only one panel. - */ - protected PanelTerm panel; - - protected String name; - - /** - * Constructor. - * - * @param panel - */ - public WindowTerm(PanelTerm panel) { - this.panel = panel; - } - - /** - * Constructor. - * - * @param name - * @param panel - */ - public WindowTerm(String name, PanelTerm panel) { - this.name = name; - this.panel = panel; - } - - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.IModelObject.sashmodel.query.IQueryTerm#accept(org.eclipse.papyrus.infra.core.sasheditor.IPagesModelVisitor.sashmodel.query.IQueryVisitor, org.eclipse.emf.ecore.EObject) - * - * @param visitor - * @param panel - * @throws PagesModelException - */ - public void accept(IPagesModelVisitor visitor, M windowModel) throws PagesModelException { - - visitor.walk(this, windowModel); - - } - - - /** - * @return the panel - */ - public PanelTerm getPanel() { - return panel; - } - - - /** - * @return the name - */ - public String getName() { - return name; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/package-info.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/package-info.java deleted file mode 100644 index cdc2289dac8..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -/** - * @author cedric dumoulin - * - */ -package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; \ No newline at end of file diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/AllTests.java deleted file mode 100644 index 462ff9469b8..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/AllTests.java +++ /dev/null @@ -1,32 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010 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 - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.tests; - -import org.junit.runner.RunWith; -import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; -import org.junit.runners.Suite.SuiteClasses; - - -/** - * All tests for this plugin - */ -@RunWith(ClassificationSuite.class) -@SuiteClasses({ -// testModel1 -org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.AllTests.class, -org.eclipse.papyrus.infra.core.sasheditor.editor.AllTests.class, -org.eclipse.papyrus.infra.core.sasheditor.internal.AllTests.class, -org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.AllTests.class -}) -public class AllTests { - //Testsuite -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/AllTests.java deleted file mode 100644 index 91fbcd0d3c1..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/AllTests.java +++ /dev/null @@ -1,33 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor; - -import org.junit.runner.RunWith; -import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; -import org.junit.runners.Suite.SuiteClasses; - - -/** - * @author cedric dumoulin - * - */ -@RunWith(ClassificationSuite.class) -@SuiteClasses({ FakeEditorInputTest.class, - FakeMultiSashPageEditorTest.class - }) - -public class AllTests { - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInput.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInput.java deleted file mode 100644 index 6f3d734817c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInput.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IPersistableElement; -import org.eclipse.ui.part.FileEditorInput; - -/** - * A fake {@link IEditorInput} suitable for creating TextEditor. - * This IEditorInput allows to carry the {@link ISashWindowsContentProvider} to the created Editor. - * - * - * @copy Copied from org.eclipse.ui.internal.part.NullEditorInput v3.8 - */ -public class FakeEditorInput extends FileEditorInput implements IEditorInput { - - protected ISashWindowsContentProvider contentProvider; - - static int count =0; - - /** - * Create a temporary file to pass to the texteditor. - * @return - */ - static IFile createIFile() { - // the name used is no important as nothing is created. - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.tests.tmp"); - IFile model1File = p.getFile("tmp/model" + count++ +".txt"); -// System.err.println("file: " + model1File.getName()); - return model1File; - } - - /** - * Creates a FakeEditorInput. - */ - public FakeEditorInput() { - super(createIFile()); - } - - /** - * Constructor. - * Carry the contentProvider to the created editor. - * - * @param contentProvider - */ - public FakeEditorInput(ISashWindowsContentProvider contentProvider) { - super(createIFile()); - this.contentProvider = contentProvider; - } - - /** - * - * @return - */ - public ISashWindowsContentProvider getContentProvider() { - return contentProvider; - } - - /** - * - * @param contentProvider - */ - public void setContentProvider(ISashWindowsContentProvider contentProvider) { - this.contentProvider = contentProvider; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IEditorInput#exists() - */ - public boolean exists() { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IEditorInput#getImageDescriptor() - */ - public ImageDescriptor getImageDescriptor() { - return ImageDescriptor.getMissingImageDescriptor(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IEditorInput#getName() - */ -// public String getName() { -// String result = null; -// return ""; //$NON-NLS-1$ -// } - - /* (non-Javadoc) - * @see org.eclipse.ui.IEditorInput#getPersistable() - */ - public IPersistableElement getPersistable() { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IEditorInput#getToolTipText() - */ - public String getToolTipText() { - return ""; //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) { - return null; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInputTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInputTest.java deleted file mode 100644 index 3f86e9bf682..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInputTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; -import org.eclipse.ui.IEditorInput; -import org.junit.Assert; -import org.junit.Test; - - -/** - * @author dumoulin - * - */ -public class FakeEditorInputTest { - - /** - * Test method for {@link org.eclipse.ui.part.FileEditorInput#equals(java.lang.Object)}. - */ - @Test - //@Ignore - public void testEquals() { - - - ISashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - IEditorInput input1 = new FakeEditorInput(contentProvider); - - IEditorInput input2 = new FakeEditorInput(contentProvider); - - Assert.assertNotEquals("input are different", input1, input2); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditor.java deleted file mode 100644 index 2136d09e0d2..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditor.java +++ /dev/null @@ -1,386 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009 CEA LIST & LIFL - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.editor.IMultiPageEditorPart; -import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer; -import org.eclipse.papyrus.infra.core.sasheditor.internal.IMultiEditorManager; -import org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer; -import org.eclipse.papyrus.infra.core.sasheditor.internal.eclipsecopy.MultiPageSelectionProvider; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.part.EditorPart; - -/** - * A fake editor used for JUnit tests. - * - * This main editor provide the minimum required to let a {@link SashWindowsContainer} run inside. - * It allows addition of pages (editor and components). - * To create an instance of this editor, use one of the {@link #openEditor()} method. It is possible to provide - * a {@link ISashWindowsContentProvider} fully initialized. - * See {@link FakeMultiSashPageEditorTest} for code examples. - * - * For tests to run properly, the editor should be registered as eclipse extension: - * - *
- * {@code
- *     
- *       
- *       
- *    
- *  }
- * 
- * - * @author Cedric Dumoulin - */ -public class FakeMultiSashPageEditor extends EditorPart implements IMultiEditorManager, IMultiPageEditorPart { - - /** - * Id used to register this editor in Eclipse. - * Can be used to open the editor. - */ - public static String EditorID = "org.eclipse.papyrus.infra.core.sasheditor.tests.editor.FakeMultiSashPageEditor"; - - /** The pageProvider */ - private ISashWindowsContentProvider pageProvider; - - /** The sash windows system :-) */ - private SashWindowsContainer sashContainer; - - /** - * IEditorPart of the opened editor. - */ - protected IEditorPart mainEditorPart; - - - /** - * Return an instance of the editor inside the Eclipse framework. - * The Editor should be registered to Eclipse extension. - * The editor will be created with the specified number of nested editors of type {@link TestTextEditor} - * - * @param nestedEditorCount - * Number of expected nested editors. - * - * @throws PartInitException - */ - public static FakeMultiSashPageEditor openEditor(int nestedEditorCount) throws PartInitException { - // Create a content provider with one editor - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - // Create pages and add them to the default folder - for(int i = 0; i < nestedEditorCount; i++) { - IPageModel newModel = new TextEditorPartModel("editor" + i); - contentProvider.addPage(newModel); - } - - return openEditor(contentProvider); - } - - /** - * Return an instance of the editor inside the Eclipse framework. - * The Editor should be registered to Eclipse extension. - * The editor will contain one nested editor. - * - * @throws PartInitException - */ - public static FakeMultiSashPageEditor openEditor() throws PartInitException { - - return openEditor(1); - } - - private static class OpenEditorRunnable implements Runnable { - - private ISashWindowsContentProvider contentProvider; - - private FakeMultiSashPageEditor editor; - - public OpenEditorRunnable(ISashWindowsContentProvider contentProvider) { - this.contentProvider = contentProvider; - } - - public void run() { - IEditorInput input = new FakeEditorInput(contentProvider); - - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - IWorkbenchPage page = window.getActivePage(); - try { - IEditorPart part = page.openEditor(input, FakeMultiSashPageEditor.EditorID); - - this.editor = (FakeMultiSashPageEditor)part; - } catch (PartInitException ex) { - ex.printStackTrace(System.out); - } - } - - public FakeMultiSashPageEditor getEditor() { - return editor; - } - } - - /** - * Return an instance of the editor inside the Eclipse framework. - * The Editor should be registered to Eclipse extension. - * - * @throws PartInitException - */ - public static FakeMultiSashPageEditor openEditor(ISashWindowsContentProvider contentProvider) throws PartInitException { - OpenEditorRunnable runnable = new OpenEditorRunnable(contentProvider); - Display.getDefault().syncExec(runnable); - return runnable.getEditor(); - } - - /** - * Close the specified editor. - * - * @param editor - */ - public static void closeEditor(final FakeMultiSashPageEditor editor) { - Display.getDefault().syncExec(new Runnable() { - - public void run() { - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - IWorkbenchPage page = window.getActivePage(); - page.closeEditor(editor, false); - } - }); - } - - /** - * get the contentProvider. Create it if necessary. - * - * @return - */ - public ISashWindowsContentProvider getContentProvider() { - - return getContentProviderImpl(); - } - - /** - * get the contentProvider. Create it if necessary. - * This return the internal implementation. - * Misc method. If the internal impl is not of the specified type, throw an exception ... - * - * @return - */ - public SimpleSashWindowsContentProvider getContentProviderImpl() { - if(pageProvider == null) { - pageProvider = createPageProvider(); - } - - return (SimpleSashWindowsContentProvider)pageProvider; - } - - /** - * Set the contentProvider if not set. If it is already set, this method do not change it. - * - * @param contentProvider - */ - public void setContentProvider(ISashWindowsContentProvider contentProvider) { - if(pageProvider == null) { - pageProvider = contentProvider; - } - } - - /** - * Create and initialize the pageProvider. - */ - protected ISashWindowsContentProvider createPageProvider() { - ISashWindowsContentProvider pageProvider = new SimpleSashWindowsContentProvider(); - // Adding requested pages - pageProvider.addPage(new TextEditorPartModel()); - - return pageProvider; - } - - /** - * Handles a property change notification from a nested editor. The default implementation simply forwards the change to - * listeners on this multi-page editor by calling firePropertyChange with the same property id. For example, if - * the dirty state of a nested editor changes (property id IEditorPart.PROP_DIRTY), this method handles it - * by firing a property change event for IEditorPart.PROP_DIRTY to property listeners on this multi-page - * editor. - *

- * Subclasses may extend or reimplement this method. - *

- * - * @copiedfrom org.eclipse.ui.part.MultiPageEditorPart.handlePropertyChange(int) - * - * @param propertyId - * the id of the property that changed - */ - // protected void handlePropertyChange(int propertyId) { - // firePropertyChange(propertyId); - // } - - /** - * The MultiPageEditorPart implementation of this IEditorPart method sets its site to the given - * site, its input to the given input, and the site's selection provider to a MultiPageSelectionProvider. - * Subclasses may extend this method. - * - * @copiedfrom org.eclipse.ui.part.MultiPageEditorPart - * @param site - * The site for which this part is being created; must not be null. - * @param input - * The input on which this editor should be created; must not be null. - * @throws PartInitException - * If the initialization of the part fails -- currently never. - */ - @Override - public void init(IEditorSite site, IEditorInput input) throws PartInitException { - - // Check if the input carry a ContentProvider. - if(input instanceof FakeEditorInput) { - // Get the content provider from the input - FakeEditorInput providerInput = (FakeEditorInput)input; - ISashWindowsContentProvider provider = providerInput.getContentProvider(); - if(provider != null) { - setContentProvider(provider); - } - } - - setSite(site); - setInput(input); - site.setSelectionProvider(new MultiPageSelectionProvider(this)); - } - - /** - * Create the part controls. {@inheritDoc} - */ - @Override - public void createPartControl(Composite parent) { - - // Create and intialize sash windows - sashContainer = new SashWindowsContainer(this); - sashContainer.setContentProvider(getContentProvider()); - sashContainer.createPartControl(parent); - activate(); - } - - /** - * Method to activate the editor. - * Called immediately after createPartControl() is complete. - * To be implemented by subclasses. Default implementation do nothing. - */ - protected void activate() { - } - - /** - * Method to deactivate the editor. - * Called when dispose() is called. - * To be implemented by subclasses. Default implementation do nothing. - */ - protected void deactivate() { - } - - /** - * Dispose the Editor. Also dispose the sashsystem. - * - * @see org.eclipse.ui.part.WorkbenchPart#dispose() - * - */ - @Override - public void dispose() { - deactivate(); - super.dispose(); - // System.err.println("editor disposed"); - // Clean references - mainEditorPart = null; - pageProvider = null; - sashContainer = null; - } - - /** - * Refresh the sash windows system - */ - public void refreshTabs() { - if(sashContainer != null) { - sashContainer.refreshTabs(); - } - - } - - - /** - * Needed by MultiPageActionBarContributor and MultiPageSelectionProvider. - */ - public IEditorPart getActiveEditor() { - return sashContainer.getActiveEditor(); - } - - /** - * Get the {@link ISashWindowsContainer}. - * Note the the ISashWindowsContainer can also be acuired with getAdapter(ISashWindowsContainer.class). - */ - public ISashWindowsContainer getISashWindowsContainer() { - return sashContainer; - } - - /** - * Get the {@link ISashWindowsContainer}. - * Note the the ISashWindowsContainer can also be acuired with getAdapter(ISashWindowsContainer.class). - */ - public SashWindowsContainer getSashWindowsContainer() { - return sashContainer; - } - - /** - * - * {@inheritDoc} - */ - @Override - public void setFocus() { - sashContainer.setFocus(); - - } - - /** - * (non-Javadoc) - * Method declared on IEditorPart. - */ - @Override - public boolean isSaveAsAllowed() { - return false; - } - - @Override - public void doSave(IProgressMonitor monitor) { - - } - - @Override - public void doSaveAs() { - - } - - @Override - public boolean isDirty() { - return false; - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditorTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditorTest.java deleted file mode 100644 index 2f16a08158b..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditorTest.java +++ /dev/null @@ -1,252 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.junit.After; -import org.junit.Test; - - -/** - * Tests for testing the {@link FakeMultiSashPageEditor} test editor. - * - * @author Cedric dumoulin - * - */ -public class FakeMultiSashPageEditorTest /* extends AbstractPapyrusTest */{ - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - Display.getDefault().syncExec(new Runnable() { - - public void run() { - // Close all remaining opened editors - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - IWorkbenchPage page = window.getActivePage(); - page.closeAllEditors(false); - } - }); - } - - /** - * Test openEditor with a provided provider. - * - * @throws Exception - */ - @Test - public void testOpenEditor_contentProvider() throws Exception { - - // Create a content provider - SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); - - // Create pages and add them to the default folder - List models = new ArrayList(); - for(int i = 0; i < 3; i++) { - IPageModel newModel = new TextEditorPartModel("model" + i); - contentProvider.addPage(newModel); - models.add(newModel); - } - - FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(contentProvider); - - assertNotNull("Editor is created", editor); - assertSame("ContentProvider is set", contentProvider, editor.getContentProvider()); - - // Check nested editor types - IEditorPart nestedEditor = editor.getActiveEditor(); - assertTrue("nested editor is of right type", (nestedEditor instanceof TestTextEditor)); - - FakeMultiSashPageEditor.closeEditor(editor); - } - - /** - * Test openEditor with a provided provider. - * - * @throws Exception - */ - @Test - public void testOpenEditor() throws Exception { - - FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(); - - assertNotNull("Editor is created", editor); - assertNotNull("ContentProvider is set", editor.getContentProvider()); - IEditorPart activeEditor = editor.getActiveEditor(); - assertNotNull("Active editor set", activeEditor); - - // Check nested editor types - IEditorPart nestedEditor = editor.getActiveEditor(); - assertEquals("nested editor is of right type", TestTextEditor.class, nestedEditor.getClass()); - - FakeMultiSashPageEditor.closeEditor(editor); - } - - /** - * Test openEditor with a provided provider. - * - * @throws Exception - */ - @Test - public void testOpenEditor_nestedEditorCount() throws Exception { - - int nestedEditorCount = 4; - - FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(nestedEditorCount); - - assertNotNull("Editor is created", editor); - assertNotNull("ContentProvider is set", editor.getContentProvider()); - IEditorPart activeEditor = editor.getActiveEditor(); - assertNotNull("Active editor set", activeEditor); - - // Check nested editor types - IEditorPart nestedEditor = editor.getActiveEditor(); - assertEquals("nested editor is of right type", TestTextEditor.class, nestedEditor.getClass()); - - FakeMultiSashPageEditor.closeEditor(editor); - } - - /** - * Test openEditor with a provided provider. - * - * @throws Exception - */ - @Test - public void testCloseEditor() throws Exception { - - FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(); - - assertNotNull("Editor is created", editor); - assertNotNull("ContentProvider is set", editor.getContentProvider()); - IEditorPart activeEditor = editor.getActiveEditor(); - assertNotNull("Active editor set", activeEditor); - - // Check nested editor types - IEditorPart nestedEditor = editor.getActiveEditor(); - assertEquals("nested editor is of right type", TestTextEditor.class, nestedEditor.getClass()); - - FakeMultiSashPageEditor.closeEditor(editor); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.FakeMultiSashPageEditor#getActiveEditor()}. - * - * @throws PartInitException - */ - @Test - public void testGetSashContainer() throws PartInitException { - FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(); - - assertNotNull("Container is set", editor.getSashWindowsContainer()); - - FakeMultiSashPageEditor.closeEditor(editor); - } - - /** - * Check if we can start several {@link FakeMultiSashPageEditor} in the same time - * - * @throws PartInitException - */ - @Test - public void testStartMultipleFakeEditors() throws PartInitException { - - - FakeMultiSashPageEditor editor1 = FakeMultiSashPageEditor.openEditor(2); - FakeMultiSashPageEditor editor2 = FakeMultiSashPageEditor.openEditor(2); - FakeMultiSashPageEditor editor3 = FakeMultiSashPageEditor.openEditor(2); - - assertNotSame("got different editors", editor1, editor2); - assertNotSame("got different editors", editor1, editor3); - assertNotSame("got different editors", editor2, editor3); - - FakeMultiSashPageEditor.closeEditor(editor1); - FakeMultiSashPageEditor.closeEditor(editor2); - FakeMultiSashPageEditor.closeEditor(editor3); - - } - - /** - * Check if we can start several {@link FakeMultiSashPageEditor} in the same time - * - * @throws PartInitException - */ - @Test - public void testStartMultipleFakeEditorsOneByOne() throws PartInitException { - - - FakeMultiSashPageEditor editor1 = FakeMultiSashPageEditor.openEditor(); - FakeMultiSashPageEditor.closeEditor(editor1); - - FakeMultiSashPageEditor editor2 = FakeMultiSashPageEditor.openEditor(); - assertNotSame("got different editors", editor1, editor2); - FakeMultiSashPageEditor.closeEditor(editor2); - - - FakeMultiSashPageEditor editor3 = FakeMultiSashPageEditor.openEditor(); - - assertNotSame("got different editors", editor1, editor3); - assertNotSame("got different editors", editor2, editor3); - - FakeMultiSashPageEditor.closeEditor(editor3); - } - - /** - * Check if we can start several {@link FakeMultiSashPageEditor} in the same time. Here - * editors are closed by calling editor.dispose(). - * This test succeed, but exception are outputted because the dispose() on editor doesn't - * fried the editors from workbench. - * - * @throws PartInitException - */ - @Test - //@Ignore - public void testStartMultipleFakeEditorsOneByOneAndDispose() throws PartInitException { - - - FakeMultiSashPageEditor editor1 = FakeMultiSashPageEditor.openEditor(); - editor1.dispose(); - - FakeMultiSashPageEditor editor2 = FakeMultiSashPageEditor.openEditor(); - assertNotSame("got different editors", editor1, editor2); - editor2.dispose(); - - - FakeMultiSashPageEditor editor3 = FakeMultiSashPageEditor.openEditor(); - - assertNotSame("got different editors", editor1, editor3); - assertNotSame("got different editors", editor2, editor3); - - editor3.dispose(); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TestTextEditor.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TestTextEditor.java deleted file mode 100644 index ee1eee01e96..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TestTextEditor.java +++ /dev/null @@ -1,128 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009 CEA LIST & LIFL - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor; - -import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords; -import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceLogger; -import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecordsFactory; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.editors.text.TextEditor; - - -/** - * A TextEditor that can be used as Tab of a sashes window. - * - * @author dumoulin - */ -public class TestTextEditor extends TextEditor { - - private TraceLogger traceLog; - /** - * Id used to register this editor in Eclipse. - * Can be used to open the editor. - */ - public static String EditorID = "org.eclipse.papyrus.infra.core.sasheditor.tests.editor.TestTextEditor"; - - /** - * - */ - public TestTextEditor() { - this("", false); - } - - /** - * - * Constructor. - * - * @param namespace Namespace used to associated traces - * @param traceRecords Records where traces should be put. - */ - public TestTextEditor(String name, ITraceRecords traceRecords) { - this.traceLog = new TraceLogger(name, traceRecords); - } - - /** - * - * Constructor. - * - * @param namespace Namespace used to associated traces - * @param isRecording true is the traceRecord should record. - */ - public TestTextEditor(String name, boolean isRecording) { - this(name, TraceRecordsFactory.createTraceRecords(isRecording)); - } - - - /** - * @return the traceLog - */ - public TraceLogger getTraceLog() { - return traceLog; - } - - /** - * Set the namespace of this part. {@inheritDoc} - */ - @Override - public void setPartName(String partName) { - super.setPartName(partName); - } - - /** - * Trace the call - * @see org.eclipse.ui.editors.text.TextEditor#dispose() - * - */ - @Override - public void dispose() { - // Trace the call - traceLog.trace("dispose"); - - super.dispose(); - } - - /** - * Close the specified editor. - * @param editor - */ - public static void closeEditor( TestTextEditor editor ) { - IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - IWorkbenchPage page = window.getActivePage(); - page.closeEditor(editor, false); - } - - /** - * Return an instance of the editor inside the Eclipse framework. - * The Editor should be registered to Eclipse extension. - * The editor will contain one nested editor. - * @throws PartInitException - */ - public static TestTextEditor openEditor() throws PartInitException { - - IEditorInput input = new FakeEditorInput(); - - IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - IWorkbenchPage page = window.getActivePage(); - IEditorPart part = page.openEditor(input, EditorID); - - return (TestTextEditor)part; - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TextEditorPartModel.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TextEditorPartModel.java deleted file mode 100644 index 3b050c935f4..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TextEditorPartModel.java +++ /dev/null @@ -1,129 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2009, 2014 LIFL, 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: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * Christian W. Damus (CEA) - bug 392301 - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel; -import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords; -import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecordsFactory; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.part.EditorActionBarContributor; - -/** - * Description of the first page - * - * @author dumoulin - */ - -public class TextEditorPartModel implements IEditorModel { - - /** - * Records used to record traces. - */ - private ITraceRecords traceRecords; - - private String title; - - - static private int count = 0; - - /** - * @param title - */ - public TextEditorPartModel(String title) { - this( title, false); - } - - /** - * @param title - */ - public TextEditorPartModel(String title, boolean isRecording) { - this(title, TraceRecordsFactory.createTraceRecords(isRecording)); - - } - - /** - * - */ - public TextEditorPartModel() { - this( null, false); - } - - /** - * @param title - */ - public TextEditorPartModel(String title, ITraceRecords traceRecords) { - this.title = title; - if( title == null) - this.title = "newText" + count++; - - this.traceRecords = traceRecords; - } - - - /** - * @return the traceRecords - */ - public ITraceRecords getTraceRecords() { - return traceRecords; - } - - - /** - * @param traceRecords the traceRecords to set - */ - public void setTraceRecords(ITraceRecords traceRecords) { - this.traceRecords = traceRecords; - } - - public IEditorPart createIEditorPart() throws PartInitException { - - // Create an editor with the requested traceRecords - TestTextEditor editor = new TestTextEditor(title, traceRecords); - - editor.setPartName(title); - - return editor; - } - - public Image getTabIcon() { - return null; - } - - public String getTabTitle() { - return title; - } - - /** - * Return this. In this implementation, the rawModel and the IEditorModel are the same. - * - */ - public Object getRawModel() { - return this; - } - - /** - * Return the ActionBarContributor dedicated to the created editor. - * Can return null if no particular ActionBarContributor is required.; - */ - public EditorActionBarContributor getActionBarContributor() { - return null; - } - - public void dispose() { - // Pass - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/ISashWindowsContentProviderTestUtils.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/ISashWindowsContentProviderTestUtils.java deleted file mode 100644 index d647f9bc261..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/ISashWindowsContentProviderTestUtils.java +++ /dev/null @@ -1,78 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.tests.utils; - -import java.util.Map; - -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; -import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; - - -/** - * Common interface for utilities dedicated to IContentProvider tests. Implementations of this class - * allow to create an internal model according to a provided {@link IModelExp}. It is also possible - * to check if the internal model is conform to the {@link IModelExp}. - * - *
- * There is several {@link ISashWindowsContentProvider} implementations, but a lot of tests are commons to - * all the implementations. The interface allows to develop common tests regardless of the real implementation. - *
- * One develop common tests using {@link ISashWindowsContentProvider} and {@link IContentProviderTestUtils}. Then, - * this test is subclassed and the appropriate implementations are specified in the subclasses. - * - * - * @author cedric dumoulin - * - */ -public interface ISashWindowsContentProviderTestUtils { - - /** - * Create an internal model conform to the specified query. - * Any previous model is disguarded. - * - * Some implementations do not allow to call this method more than once. In this case, - * the implementation should throw an Exception. - * - * @param query Should be a subtype PanelTerm (Folder, HSash, VSash) - * @throws QueryException - * - */ - public abstract void createModel(IModelExp query) throws PagesModelException; - - /** - * Check if the internal model is conformed to the specified query. - * @param query - * @throws QueryException - */ - public abstract void assertConform(IModelExp query) throws PagesModelException; - - /** - * Get element in the model. - * Each model element whose corresponding model query part as a name is added to the result map. - * The element is then accessible with the name set in the query part. - * - * @param query - * @return - * @throws QueryException - */ - public abstract Map queryModel(IModelExp query) throws PagesModelException; - - /** - * Get the {@link ISashWindowsContentProvider} associated to this utility class. - * @return - */ - public ISashWindowsContentProvider getIContentProvider(); -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/LeakingObject.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/LeakingObject.java deleted file mode 100644 index 4a49d9eb622..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/LeakingObject.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak; - -import java.util.HashMap; -import java.util.Map; - -/** - * For testing purpose - * @copyright http://www.forkcan.com/viewcode/215/Detecting-memory-leak-in-unit-test - * - */ -public class LeakingObject { - - static Map leakingMap = new HashMap(); - - public LeakingObject() { - leakingMap.put(this, System.currentTimeMillis()); - } - -} \ No newline at end of file diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakTest.java deleted file mode 100644 index ffec1460fcb..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakTest.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak; -import static org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak.MemoryLeakUtil.assertIsGarbageCollected; -import static org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak.MemoryLeakUtil.assertIsGarbageCollected2; - -import java.lang.ref.WeakReference; - -import org.junit.Test; - - -/** - * Test the memory ling assertions. - * - * @copyright http://www.forkcan.com/viewcode/215/Detecting-memory-leak-in-unit-test - * - */ -public class MemoryLeakTest { - - /* This test of the LeakingObject will fail */ - @Test - public void testLeakingObject() { - LeakingObject lo = new LeakingObject(); - - // 1. Create WeakReference for the object - WeakReference loWeakRef = new WeakReference(lo); - - // 2. Remove strong reference for the object - lo = null; - - // 3. Test object is garbage collected correctly - assertIsGarbageCollected(loWeakRef, 10*1000); - } - - /* This test of the NonLeakingObject will succeed */ - @Test - public void testNonLeakingObject() { - NonLeakingObject lo = new NonLeakingObject(); - - // 1. Create WeakReference for the object - WeakReference loWeakRef = new WeakReference(lo); - - // 2. Remove strong reference for the object - lo = null; - - // 3. Test object is garbage collected correctly - assertIsGarbageCollected(loWeakRef, 10*1000); - } - -/* This test of the LeakingObject will fail */ - @Test - public void testLeakingObject2() { - LeakingObject lo = new LeakingObject(); - - // 1. Create WeakReference for the object - WeakReference loWeakRef = new WeakReference(lo); - - // 2. Remove strong reference for the object - lo = null; - - // 3. Test object is garbage collected correctly - assertIsGarbageCollected2(loWeakRef, 10*1000); - } - -/* This test of the NonLeakingObject will succeed */ - @Test - public void testNonLeakingObject2() { - NonLeakingObject lo = new NonLeakingObject(); - - // 1. Create WeakReference for the object - WeakReference loWeakRef = new WeakReference(lo); - - // 2. Remove strong reference for the object - lo = null; - - // 3. Test object is garbage collected correctly - assertIsGarbageCollected2(loWeakRef, 10*1000); - } - - -} \ No newline at end of file diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakUtil.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakUtil.java deleted file mode 100644 index e235cc7947c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakUtil.java +++ /dev/null @@ -1,201 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak; - -import static org.junit.Assert.fail; - -import java.lang.ref.PhantomReference; -import java.lang.ref.Reference; -import java.lang.ref.ReferenceQueue; -import java.lang.ref.WeakReference; - -/** - * Provides an assertion method to verify that an object has been garbage collected. - * - * This method forward to one of the two implementations: - *
- * {@link #assertIsGarbageCollected0(WeakReference, long)} - *
- * {@link #assertIsGarbageCollected2(WeakReference, long)} - * - */ -public class MemoryLeakUtil { - - private static final int MAX_GC_ITERATIONS = 20; - private static final int GC_SLEEP_TIME = 100; - - public static void assertIsGarbageCollected(WeakReference ref, long timeout) { - // Slower method -// assertIsGarbageCollected0(ref, timeout); - // Faster method - assertIsGarbageCollected2(ref, timeout); - } - - /** - * Check that the specified Object (referenced through a WeakReference) is garbage collected - * in the designated time. Otherwise throw an assertion failure. - *

- * IMPORTANT : in order for this method to work properly and success, you must get rid of all - * strong references of your object in the method callee. For example : - *

-   *  MyObject myObj = new MyObject();
-   *  // myObj.work();
-   *  // myObj.close();
-   *  
-   *  // 1. Create WeakReference for the object
-   *  WeakReference objWeakRef = new WeakReference(pub1); 
-   *  // 2. Remove strong reference for the object
-   *  myObj = null;  
-   *  // 3. Test object is garbage collected correctly, leaving 10 seconds for the test to succeed
-   *  assertObjectIsGarbageCollected(objWeakRef, 10*1000);
-   * 
- *

- * Implementation note : this method will trigger a GC through - * System.gc() every second until the timeout has been - * reached or the object is detected has garbage collected. - * - * @param wRef the object WeakReference (required to prevent strong reference of object through callstack) - * @param timeout the timeout after which this method will consider (should be a multiple of 1000 ms with current implementation) - * @throws Exception - */ - public static void assertIsGarbageCollected0(WeakReference ref, long timeout) { - - // already cleared ? - if( ref.get() == null) - return; - - for (int i = 0; i < MAX_GC_ITERATIONS; i++) { - s_runtime.runFinalization(); -// System.err.println("Try to garbage iter " + i); - try { - runGC(); - } catch (Exception e1) { - e1.printStackTrace(); - } - - if (ref.get() == null) - return ; - - // Pause for a while and then go back around the loop to try again... - try { - Thread.sleep(GC_SLEEP_TIME); - } catch (InterruptedException e) { - // Ignore any interrupts and just try again... - } - } - - fail("Object '" + ref.get() + "' was not be garbage collected "); - - } - - /** - * Check that the specified Object (referenced through a WeakReference) is garbage collected - * in the designated time. Otherwise throw an assertion failure. - *

- * IMPORTANT : in order for this method to work properly and success, you must get rid of all - * strong references of your object in the method callee. For example : - *

-   *  MyObject myObj = new MyObject();
-   *  // myObj.work();
-   *  // myObj.close();
-   *  
-   *  // 1. Create WeakReference for the object
-   *  WeakReference objWeakRef = new WeakReference(pub1); 
-   *  // 2. Remove strong reference for the object
-   *  myObj = null;  
-   *  // 3. Test object is garbage collected correctly, leaving 10 seconds for the test to succeed
-   *  assertObjectIsGarbageCollected(objWeakRef, 10*1000);
-   * 
- *

- * Implementation note : this method will trigger a GC through - * System.gc() every second until the timeout has been - * reached or the object is detected has garbage collected. - * - * @param wRef the object WeakReference (required to prevent strong reference of object through callstack) - * @param timeout the timeout after which this method will consider (should be a multiple of 1000 ms with current implementation) - */ - public static void assertIsGarbageCollected2(WeakReference wRef, long timeout) { - final long PERIOD = 1000; // Perform GC and check every second; - - final long startTime = System.currentTimeMillis(); - - // Create a reference queue - ReferenceQueue rq = new ReferenceQueue(); - - // Add some phantom reference object to the queue - // the pr variable is never read, but there nothing to do with it - @SuppressWarnings("unused") - PhantomReference pr = new PhantomReference(wRef.get(), rq); - - // Poll the queue until the Reference is returned or the timeout is reached. - // If a non null value is returned by poll, it will indicate that the original - // object has been garbage collected - Reference ref = rq.poll(); - while (ref == null) { - System.gc(); // Trigger GC to help a bit - try { Thread.sleep(PERIOD); } catch (InterruptedException ex) {} - ref = rq.poll(); - - // Exit loop if timeout has been reached - long now = System.currentTimeMillis(); - if ((now - startTime) > timeout) { - break; - } - } - - - - // If no PhantomReference was found after the specified timeout, the garbage collection was unsuccessful - if (ref == null) { - // But before declaring it as a failure, check the WeakRefence - // -> If the WeakReference has been removed, then the object is not strongly reachable - // anymore so it also mean it has been garbage collected - Object obj = wRef.get(); - if (obj == null) { - return; - } - - fail("Object '" + wRef.get() + "' was not be garbage collected during the timeout of " + timeout + " ms"); - } - } - - - private static void runGC () throws Exception - { - // It helps to call Runtime.gc() - // using several method calls: - for (int r = 0; r < 4; ++ r) _runGC (); - } - - private static void _runGC () throws Exception - { - long usedMem1 = usedMemory (), usedMem2 = Long.MAX_VALUE; - for (int i = 0; (usedMem1 < usedMem2) && (i < 500); ++ i) - { - s_runtime.runFinalization (); - s_runtime.gc (); - Thread.yield (); - - usedMem2 = usedMem1; - usedMem1 = usedMemory (); - } - } - private static long usedMemory () - { - return s_runtime.totalMemory () - s_runtime.freeMemory (); - } - - private static final Runtime s_runtime = Runtime.getRuntime (); -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/NonLeakingObject.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/NonLeakingObject.java deleted file mode 100644 index cb5b097624c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/NonLeakingObject.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak; - -import java.util.Map; -import java.util.WeakHashMap; - - -/** - * For testing purpose - * @copyright http://www.forkcan.com/viewcode/215/Detecting-memory-leak-in-unit-test - * - */ -public class NonLeakingObject { - - static Map leakingMap = new WeakHashMap(); - - public NonLeakingObject() { - leakingMap.put(this, System.currentTimeMillis()); - } - -} \ No newline at end of file diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/package-info.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/package-info.java deleted file mode 100644 index ee1b85d4846..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -/** - * @author dumoulin - * - */ -package org.eclipse.papyrus.infra.core.sasheditor.tests.utils; \ No newline at end of file diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/ITraceRecords.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/ITraceRecords.java deleted file mode 100644 index ff263804187..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/ITraceRecords.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; - -import java.util.List; - - - -public interface ITraceRecords { - - /** - * Record a new trace. - * @param trace - */ - public abstract void addTrace(String trace); - - /** - * Record a new trace. - * @param trace - */ - public abstract void addTrace(String name, String trace); - - /** - * Record a new trace. - * @param trace - */ - public abstract void addTrace(String name, String trace, Object value); - - /** - * Record a new trace. - * @param trace - */ - public abstract void addTrace(String name, String trace, Object... values); - - /** - * Return the namespace and the trace in one concatenated string ("namespace,trace"). - * @param i Index of the requested trace - * @return - */ - public abstract String getFullName(int i); - - /** - * Get the value - * @param i - * @return - */ - public abstract Object getValue(int i); - - /** - * Return true if the trace contains the specified events. - * @return - */ - public abstract boolean contains(String name, String trace); - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public abstract int indexOf(String name, String trace, Object value); - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public abstract int indexOfNamespaceTrace(String name, String trace); - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public abstract int indexOfTrace(String trace); - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public abstract int indexOfNamespace(String namespace); - - /** - * Reset the trace. - */ - public abstract void reset(); - - /** - * @return the traces - */ - public abstract List getTraces(); - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/MultiValuesTraceRecord.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/MultiValuesTraceRecord.java deleted file mode 100644 index cc884399549..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/MultiValuesTraceRecord.java +++ /dev/null @@ -1,73 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; - -import java.util.ArrayList; -import java.util.List; - - -/** - * @author dumoulin - * - */ -public class MultiValuesTraceRecord extends TraceRecord { - - public List values; - - - public MultiValuesTraceRecord(String namespace, String trace, Object ... values) { - super(namespace, trace); - - // Initialie collection - this.values = new ArrayList(values.length); - for( Object o : values ) - this.values.add(o); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecord#getValue() - * - * @return - */ - @Override - public Object getValue() { - if( values.size()>0) - return values.get(0); - - // No value set. - return null; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecord#getValues() - * - * @return - */ - @Override - public List getValues() { - return values; - } - - /** - * - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecord#clear() - * - */ - @Override - public void clear() { - super.clear(); - values.clear(); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/NullTraceRecords.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/NullTraceRecords.java deleted file mode 100644 index 251a5907489..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/NullTraceRecords.java +++ /dev/null @@ -1,155 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; - -import java.util.List; - - -/** - * A {@link ITraceRecords} recording nothing. - * - * @author Cedric Dumoulin - * - */ -public class NullTraceRecords implements ITraceRecords { - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#addTrace(java.lang.String) - * - * @param trace - */ - public void addTrace(String trace) { - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#addTrace(java.lang.String, java.lang.String) - * - * @param name - * @param trace - */ - public void addTrace(String name, String trace) { - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#addTrace(java.lang.String, java.lang.String, java.lang.Object) - * - * @param name - * @param trace - * @param value - */ - public void addTrace(String name, String trace, Object value) { - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#addTrace(java.lang.String, java.lang.String, java.lang.Object[]) - * - * @param name - * @param trace - * @param values - */ - public void addTrace(String name, String trace, Object... values) { - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#getFullName(int) - * - * @param i - * @return - */ - public String getFullName(int i) { - return null; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#getValue(int) - * - * @param i - * @return - */ - public Object getValue(int i) { - throw new UnsupportedOperationException("Not available"); - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#contains(java.lang.String, java.lang.String) - * - * @param name - * @param trace - * @return - */ - public boolean contains(String name, String trace) { - return false; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#indexOf(java.lang.String, java.lang.String, java.lang.Object) - * - * @param name - * @param trace - * @param value - * @return - */ - public int indexOf(String name, String trace, Object value) { - return -1; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#indexOfNamespaceTrace(java.lang.String, java.lang.String) - * - * @param name - * @param trace - * @return - */ - public int indexOfNamespaceTrace(String name, String trace) { - return -1; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#indexOfTrace(java.lang.String) - * - * @param trace - * @return - */ - public int indexOfTrace(String trace) { - return -1; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#indexOfNamespace(java.lang.String) - * - * @param namespace - * @return - */ - public int indexOfNamespace(String namespace) { - return -1; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#reset() - * - */ - public void reset() { - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#getTraces() - * - * @return - */ - public List getTraces() { - throw new UnsupportedOperationException("Not available"); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/SimpleTraceRecord.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/SimpleTraceRecord.java deleted file mode 100644 index 1abaeb4698c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/SimpleTraceRecord.java +++ /dev/null @@ -1,73 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; - -import java.util.List; - - -/** - * This class represent one simple record, with only one associated value. - * @author Cedric Dumoulin - * - */ -public class SimpleTraceRecord extends TraceRecord { - - public Object value; - - /** - * Constructor. - * - * @param namespace - * @param trace - * @param value - */ - public SimpleTraceRecord(String namespace, String trace, Object value) { - super(namespace, trace); - this.value = value; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecord#getValue() - * - * @return - */ - @Override - public Object getValue() { - return value; - } - - /** - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecord#getValues() - * - * @return - */ - @Override - public List getValues() { - // TODO Return an List backuped by the single value. - throw new UnsupportedOperationException("Not yet implemented"); - } - - /** - * - * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecord#clear() - * - */ - @Override - public void clear() { - // TODO Auto-generated method stub - super.clear(); - value = null; - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceLogger.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceLogger.java deleted file mode 100644 index 30283cdd036..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceLogger.java +++ /dev/null @@ -1,115 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; - - -/** - * Instances of this class are used to log traces of a namespace. - * - * @author Cedric Dumoulin - * - */ -public class TraceLogger { - - /** - * The namespace used to tag records. - */ - protected String namespace; - - /** - * The records - */ - protected ITraceRecords records; - - /** - * Constructor. - * A logger logging nothing. - * - * @param namespace - */ - public TraceLogger(String namespace, boolean isRecording) { - this.namespace = namespace; - this.records = TraceRecordsFactory.createTraceRecords(isRecording); - } - - /** - * Constructor. - * - * @param namespace - * @param records - */ - public TraceLogger(String namespace, ITraceRecords records) { - this.namespace = namespace; - this.records = records; - } - - - /** - * @return the records - */ - public ITraceRecords getTraceRecords() { - return records; - } - - - /** - * @param records the records to set - */ - public void setTraceRecords(ITraceRecords records) { - this.records = records; - } - - - /** - * @return the namespace - */ - public String getNamespace() { - return namespace; - } - - - /** - * @param namespace the namespace to set - */ - public void setNamespace(String namespace) { - this.namespace = namespace; - } - - /** - * Record a new trace. - * @param trace - */ - public void trace(String trace) { - records.addTrace(namespace, trace, (Object)null); - } - - /** - * Record a new trace. - * @param trace - */ - public void trace(String trace, Object value) { - records.addTrace( namespace, trace, value); - } - - /** - * Record a new trace. - * @param trace - */ - public void trace(String trace, Object ... values) { - records.addTrace( namespace, trace, values); - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecord.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecord.java deleted file mode 100644 index 84b3ca10a03..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecord.java +++ /dev/null @@ -1,121 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; - -import java.util.List; - - -/** - * This interface represent one record - * @author Cedric Dumoulin - * - */ -public abstract class TraceRecord { - - public String namespace; - public String trace; - - - /** - * Constructor. - * - * @param namespace - * @param trace - */ - public TraceRecord(String namespace, String trace) { - this.namespace = namespace; - this.trace = trace; - } - - /** - * Get the full name, i.e. : the namespace, name - * @return - */ - public String getFullName() { - return namespace + "," + trace; - } - - /** - * Get the first value associated to this record. - * @return - */ - public abstract Object getValue(); - - /** - * Get all values associated to this record - * @return - */ - public abstract List getValues(); - - /** - * Return true if this object's trace equal the provided values. - * - * @param trace - * @return - */ - public boolean isEqualsToTrace( String trace) { - - return (this.trace.equals(trace)) ; - } - - /** - * Return true if this object's namespace equal the provided values. - * - * @param namespace - * @return - */ - public boolean isEqualsToNameSpace( String namespace) { - - return this.namespace.equals(namespace) ; - } - - /** - * Return true if this object's namespace and trace equal the provided values. - * If a provided value is null, it is consider as a wildcard. - * - * @param namespace - * @param trace - * @return - */ - public boolean isEqualsTo( String namespace, String trace) { - - return (namespace != null ? namespace.equals(this.namespace) : true) - && (trace != null ? trace.equals(this.trace) : true) ; - } - - /** - * Return true if this object's namespace and trace equal the provided values. - * If a provided value is null, it is consider as a wildcard. - * - * @param namespace - * @param trace - * @return - */ - public boolean isEqualsTo( String namespace, String trace, Object value) { - - return (namespace != null ? namespace.equals(this.namespace) : true) - && (trace != null ? trace.equals(this.trace) : true) - && (value != null ? value.equals(getValue()) : true); - } - - /** - * Clear the record. It will not be used anymore. This is mainly to avoid memory leak. - */ - public void clear() { - namespace = null; - trace = null; - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecords.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecords.java deleted file mode 100644 index 0a03007d24e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecords.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; - -import java.util.ArrayList; -import java.util.List; - - -/** - * A list of trace records. - * - * @author cedric dumoulin - * - */ -public class TraceRecords implements ITraceRecords { - - public Listtraces = new ArrayList(); - - /** - * Record a new trace. - * @param trace - */ - public void addTrace(String trace) { - addTrace(null, trace, (Object)null); - } - - /** - * Record a new trace. - * @param trace - */ - public void addTrace(String name, String trace) { - addTrace(name, trace, (Object)null); - } - - /** - * Record a new trace. - * @param trace - */ - public void addTrace(String name, String trace, Object value) { - traces.add(new SimpleTraceRecord( name, trace, value)); - } - - /** - * Record a new trace. - * @param trace - */ - public void addTrace(String name, String trace, Object ... values) { - traces.add(new MultiValuesTraceRecord( name, trace, values)); - } - - /** - * Return the namespace and the trace in one concatenated string ("namespace,trace"). - * @param i Index of the requested trace - * @return - */ - public String getFullName(int i) { - return traces.get(i).getFullName(); - } - - /** - * Get the value - * @param i - * @return - */ - public Object getValue(int i) { - return traces.get(i).getValue(); - } - - /** - * Return true if the trace contains the specified events. - * @return - */ - public boolean contains( String name, String trace) { - - return indexOfNamespaceTrace(name, trace) >= 0; - } - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public int indexOf(String name, String trace, Object value) { - - for (int i = 0; i < traces.size(); i++) { - TraceRecord record = traces.get(i); - - if( record.isEqualsTo(name, trace, value) ) - return i; - } - - return -1; - } - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public int indexOfNamespaceTrace(String name, String trace) { - - for (int i = 0; i < traces.size(); i++) { - TraceRecord record = traces.get(i); - - if( record.isEqualsTo(name, trace) ) - return i; - } - - return -1; - } - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public int indexOfTrace(String trace) { - - for (int i = 0; i < traces.size(); i++) { - TraceRecord record = traces.get(i); - - if( record.isEqualsToTrace(trace) ) - return i; - } - - return -1; - } - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public int indexOfNamespace(String namespace) { - - for (int i = 0; i < traces.size(); i++) { - TraceRecord record = traces.get(i); - - if( record.isEqualsToNameSpace(namespace) ) - return i; - } - - return -1; - } - - /** - * Reset the trace. - */ - public void reset() { - for( TraceRecord record : traces) { - record.clear(); - } - traces.clear(); - } - - - /** - * @return the traces - */ - public List getTraces() { - return traces; - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecordsFactory.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecordsFactory.java deleted file mode 100644 index 6f39ee9295f..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecordsFactory.java +++ /dev/null @@ -1,42 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; - - -/** - * Factory to create TraceRecords. - * @author dumoulin - * - */ -public class TraceRecordsFactory { - - - /** - * Create a TraceRecords. - * - * @param isRecording true is the traceRecord should record. - * @return - */ - public static ITraceRecords createTraceRecords( boolean isRecording ) { - - if(isRecording) { - return new TraceRecords(); - } - else { - return new NullTraceRecords(); - } - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/FakeObservableListener.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/FakeObservableListener.java deleted file mode 100644 index fb123b1d04c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/FakeObservableListener.java +++ /dev/null @@ -1,84 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.utils; - -import java.util.ArrayList; -import java.util.List; - - -/** - * A fake listener for testing purpose. - * - * @author cedric dumoulin - * - */ -public class FakeObservableListener implements IObservableListListener { - - /** - * Trace of event received - */ - protected List addEvents = new ArrayList(); - - /** - * Trace of event received - */ - protected List removeEvents = new ArrayList(); - - - /** - * @return the events - */ - public List getAddEvents() { - return addEvents; - } - - /** - * @return the events - */ - public E getLastAddEvents() { - if(addEvents.size()>0) { - return addEvents.get(addEvents.size() -1); - } - - return null; - } - - /** - * @return the events - */ - public List getRemoveEvents() { - return removeEvents; - } - - /** - * @return the events - */ - public E getLastRemoveEvents() { - if(removeEvents.size()>0) { - return removeEvents.get(removeEvents.size() -1); - } - - return null; - } - - public void elementAdded(E element) { - addEvents.add(element); - } - - public void elementRemoved(E element) { - removeEvents.add(element); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/ObservableListTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/ObservableListTest.java deleted file mode 100644 index b46062e7339..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/ObservableListTest.java +++ /dev/null @@ -1,173 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.core.sasheditor.utils; - -import static org.junit.Assert.*; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - - -/** - * @author cedric dumoulin - * - */ -public class ObservableListTest { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.utils.ObservableList#ObservableList()}. - */ - @Test - public void testObservableList() { - ObservableList list = new ObservableList(); - assertNotNull("list created", list); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.utils.ObservableList#addListener(org.eclipse.papyrus.infra.core.sasheditor.utils.IObservableListListener)}. - */ - @Test - public void testAddListener() { - ObservableList list = new ObservableList(); - assertNotNull("list created", list); - - FakeObservableListener listener = new FakeObservableListener(); - - // add a listener - list.addListener(listener); - // Check if added - assertTrue("listener added", list.getListeners().contains(listener)); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.utils.ObservableList#removeListener(org.eclipse.papyrus.infra.core.sasheditor.utils.IObservableListListener)}. - */ - @Test - public void testRemoveListener() { - ObservableList list = new ObservableList(); - assertNotNull("list created", list); - - FakeObservableListener listener = new FakeObservableListener(); - - // add a listener - list.addListener(listener); - // Check if added - assertTrue("listener added", list.getListeners().contains(listener)); - - list.removeListener(listener); - // Check if added - assertFalse("list contains listener", list.getListeners().contains(listener)); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.utils.ObservableList#fireElementAddedEvent(java.lang.Object)}. - */ - @Test - public void testFireElementAddedEvent() { - ObservableList list = new ObservableList(); - assertNotNull("list created", list); - - FakeObservableListener listener = new FakeObservableListener(); - - // add a listener - list.addListener(listener); - // Check event - - list.fireElementAddedEvent("string1"); - assertEquals( "event fired", "string1", listener.getLastAddEvents() ); - - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.utils.ObservableList#fireElementRemovedEvent(java.lang.Object)}. - */ - @Test - public void testFireElementRemovedEvent() { - ObservableList list = new ObservableList(); - assertNotNull("list created", list); - - FakeObservableListener listener = new FakeObservableListener(); - - // add a listener - list.addListener(listener); - // Check event - String element = "string1"; - list.fireElementRemovedEvent(element); - assertEquals( "event fired", element, listener.getLastRemoveEvents() ); - } - - /** - * Test method for add}. - */ - @Test - public void testAdd() { - ObservableList list = new ObservableList(); - assertNotNull("list created", list); - - FakeObservableListener listener = new FakeObservableListener(); - - // add a listener - list.addListener(listener); - // Check event - - String element = "string1"; - - list.add(element); - assertEquals( "event fired", element, listener.getLastAddEvents() ); - assertEquals( "element added to list", element, list.get(list.size()-1) ); - - } - - /** - * Test method for add}. - */ - @Test - public void testRemove() { - ObservableList list = new ObservableList(); - assertNotNull("list created", list); - - FakeObservableListener listener = new FakeObservableListener(); - - // add a listener - list.addListener(listener); - // Check event - - String element = "string1"; - list.add(element); - assertEquals( "element added to list", element, list.get(list.size()-1) ); - - list.remove(element); - assertFalse( "element removed from list", list.contains(element) ); - assertEquals( "event fired", element, listener.getLastRemoveEvents() ); - - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/.classpath b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/.classpath deleted file mode 100644 index e5fa400a126..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/.classpath +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/.project b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/.project deleted file mode 100644 index 93b24f41eef..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.infra.core.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/core/org.eclipse.papyrus.infra.core.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 62a08f4494d..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.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/core/org.eclipse.papyrus.infra.core.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.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/core/org.eclipse.papyrus.infra.core.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 69403e3c645..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,15 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.junit;bundle-version="4.10.0", - org.eclipse.papyrus.junit.framework;bundle-version="1.2.0", - org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core;bundle-version="1.2.0" -Export-Package: org.eclipse.papyrus.infra.core.resource, - org.eclipse.papyrus.infra.core.services, - org.eclipse.papyrus.infra.core.tests -Bundle-Vendor: %providerName -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.infra.core.tests;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/about.html b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.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/core/org.eclipse.papyrus.infra.core.tests/build.properties b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/build.properties deleted file mode 100644 index abe693aba0b..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -source.. = test/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - plugin.xml,\ - resources/ -src.includes = about.html diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/org.eclipse.papyrus.infra.core.tests.launch b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/org.eclipse.papyrus.infra.core.tests.launch deleted file mode 100644 index 8823f1a8091..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/org.eclipse.papyrus.infra.core.tests.launch +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/plugin.properties b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/plugin.properties deleted file mode 100644 index d2860c1b07d..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.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: -# Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - initial API and implementation -################################################################################## -pluginName=Papyrus Core Test -providerName=Eclipse Modeling Project diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/plugin.xml b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/plugin.xml deleted file mode 100644 index 4be7351f353..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/plugin.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/pom.xml b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/pom.xml deleted file mode 100644 index 920d5b7af0e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.tests.releng - 1.2.0-SNAPSHOT - ../../../../../releng/main-tests - - org.eclipse.papyrus - org.eclipse.papyrus.infra.core.tests - 1.2.0-SNAPSHOT - eclipse-test-plugin - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/resources/My.ecore b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/resources/My.ecore deleted file mode 100644 index c35981cf49d..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/resources/My.ecore +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/resources/My.genmodel b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/resources/My.genmodel deleted file mode 100644 index 9495ce441eb..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/resources/My.genmodel +++ /dev/null @@ -1,11 +0,0 @@ - - - My.ecore - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/language/LanguageServiceTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/language/LanguageServiceTest.java deleted file mode 100644 index 3530a06d78e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/language/LanguageServiceTest.java +++ /dev/null @@ -1,191 +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.infra.core.language; - -import static java.util.stream.StreamSupport.stream; -import static org.hamcrest.CoreMatchers.hasItem; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.hamcrest.MatcherAssert.assertThat; - -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; - -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.resource.Resource; -import org.eclipse.papyrus.infra.core.Activator; -import org.eclipse.papyrus.infra.core.internal.language.LanguageModelRegistry; -import org.eclipse.papyrus.infra.core.resource.IEMFModel; -import org.eclipse.papyrus.infra.core.resource.IModel; -import org.eclipse.papyrus.infra.core.resource.ModelMultiException; -import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.infra.core.services.ExtensionServicesRegistry; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServiceMultiException; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; -import org.eclipse.papyrus.infra.core.utils.TransactionHelper; -import org.eclipse.papyrus.junit.utils.resources.EcoreModel; -import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; -import org.eclipse.papyrus.junit.utils.rules.ModelSetFixture; -import org.eclipse.papyrus.junit.utils.rules.PluginResource; -import org.eclipse.papyrus.junit.utils.rules.ServiceRegistryModelSetFixture; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.ClassRule; -import org.junit.Rule; -import org.junit.Test; - -/** - * Tests the Papyrus Language Service. - */ -@PluginResource({ "resources/My.ecore", "resources/My.genmodel" }) -public class LanguageServiceTest { - private static final String ECORE_LANGUAGE_ID = "org.eclipse.papyrus.infra.core.tests.language.ecore"; //$NON-NLS-1$ - private static final String ECORE_LANGUAGE_VERSION = "2.11"; //$NON-NLS-1$ - private static final String ECORE_LANGUAGE_NAME = "Ecore"; //$NON-NLS-1$ - - private static final String GENMODEL_LANGUAGE_ID = "org.eclipse.papyrus.infra.core.tests.language.genmodel"; //$NON-NLS-1$ - private static final String GENMODEL_LANGUAGE_VERSION = "2.11.0.v20150518-0831"; //$NON-NLS-1$ - private static final String GENMODEL_LANGUAGE_NAME = "Genmodel"; //$NON-NLS-1$ - - @ClassRule - public static final ModelSetFixture modelSet = new ServiceRegistryModelSetFixture(); - - private static IModel ecoreModel; - - @Rule - public final HouseKeeper houseKeeper = new HouseKeeper(); - - public LanguageServiceTest() { - super(); - } - - @Test - public void contentTypeBasedLanguages() throws ServiceException { - ILanguageService service = modelSet.requireService(ILanguageService.class); - - ILanguage ecore = null; - ILanguage genmodel = null; - for (ILanguage next : service.getLanguages(modelSet.getProject().getURI("My.ecore"), true)) { - if (ECORE_LANGUAGE_ID.equals(next.getID())) { - ecore = next; - } else if (GENMODEL_LANGUAGE_ID.equals(next.getID())) { - genmodel = next; - } - } - - assertThat(genmodel, nullValue()); // Asked only about the *.ecore resource - - assertThat(ecore, notNullValue()); - assertThat(ecore.getVersion(), is(new Version(ECORE_LANGUAGE_VERSION))); - assertThat(ecore.getName(), is(ECORE_LANGUAGE_NAME)); - } - - @Test - public void contentTypeBasedLanguages_uriWithoutExtension() throws ServiceException { - ILanguageService service = modelSet.requireService(ILanguageService.class); - - ILanguage ecore = null; - ILanguage genmodel = null; - for (ILanguage next : service.getLanguages(modelSet.getProject().getURI("My"), false)) { - if (ECORE_LANGUAGE_ID.equals(next.getID())) { - ecore = next; - } else if (GENMODEL_LANGUAGE_ID.equals(next.getID())) { - genmodel = next; - } - } - - assertThat(ecore, notNullValue()); - assertThat(ecore.getVersion(), is(new Version(ECORE_LANGUAGE_VERSION))); - assertThat(ecore.getName(), is(ECORE_LANGUAGE_NAME)); - - assertThat(genmodel, notNullValue()); - assertThat(genmodel.getVersion(), is(new Version(GENMODEL_LANGUAGE_VERSION))); - assertThat(genmodel.getName(), is(GENMODEL_LANGUAGE_NAME)); - } - - @Test - public void languageBindings() { - Collection models = ILanguageService.getLanguageModels(modelSet.getResourceSet()); - - assertThat(models, hasItem(ecoreModel)); - } - - @Test - public void contentBasedLanguagesInNewModel() throws Exception { - ServicesRegistry services = houseKeeper.cleanUpLater(new ExtensionServicesRegistry(Activator.PLUGIN_ID), reg -> { - try { - reg.disposeRegistry(); - } catch (ServiceMultiException e) { - // We expect these in the tests - } - }); - - try { - services.startRegistry(); - } catch (ServiceMultiException e) { - // These are normal - } - - ModelSet modelSet = services.getService(ModelSet.class); - - IEMFModel ecore = new EcoreModel(); - modelSet.registerModel(ecore); - - URI uri = URI.createURI("platform:/resource/test/bogus.ecore", true); - EPackage ePackage = EcoreFactory.eINSTANCE.createEPackage(); - Resource resource = modelSet.createResource(uri); - - TransactionHelper.run(modelSet.getTransactionalEditingDomain(), () -> { - resource.getContents().add(ePackage); - }); - - try { - modelSet.loadModels(uri); - } catch (ModelMultiException e) { - // We expect this - } - - List semanticRoots = ILanguageService.getLanguageModels(modelSet).stream() - .filter(IEMFModel.class::isInstance) - .map(IEMFModel.class::cast) - .flatMap(m -> stream(m.getRootElements().spliterator(), false)) - .collect(Collectors.toList()); - - assertThat(semanticRoots, hasItem(ePackage)); - } - - // - // Test framework - // - - @BeforeClass - public static void registerEcoreModel() { - ecoreModel = new EcoreModel(); - LanguageModelRegistry.INSTANCE.bind(ECORE_LANGUAGE_ID, ecoreModel.getIdentifier()); - - modelSet.getResourceSet().getInternal().registerModel(ecoreModel, false); - } - - @AfterClass - public static void unregisterEcoreModel() { - LanguageModelRegistry.INSTANCE.bind(ECORE_LANGUAGE_ID, ecoreModel.getIdentifier()); - ecoreModel = null; - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractModelWithSharedResourceTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractModelWithSharedResourceTest.java deleted file mode 100644 index 2f05f8ac076..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractModelWithSharedResourceTest.java +++ /dev/null @@ -1,328 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010, 2014 LIFL, 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: - * LIFL - Initial API and implementation - * Christian W. Damus (CEA) - bug 436047 - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.resource; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource.ModelKind; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; - - -/** - * Run as "JUnit Plugin-Test" - * - * @author cedric dumoulin - * - */ -public class AbstractModelWithSharedResourceTest extends AbstractPapyrusTest { - - @Rule - public final HouseKeeper houseKeeper = new HouseKeeper(); - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - /** - * Test that the resource is created only once. - * Test method for {@link org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#createModel(org.eclipse.core.runtime.IPath)}. - */ - @Test - public void testCreateModel() { - - String model1Key = "ecore"; - String model2Key = "genmodel"; - - // Create models with different key, but use same extension (default from FakeModelWithSharedResource) - FakeModelWithSharedResource model1 = new FakeModelWithSharedResource(ModelKind.master, model1Key, EPackage.class); - FakeModelWithSharedResource model2 = new FakeModelWithSharedResource(model2Key, EClass.class); - - ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); - modelSet.registerModel(model1); - modelSet.registerModel(model2); - - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); - - IFile model1File = p.getFile("tmp/model1." + model1Key); - - // Call creates - modelSet.createsModels(model1File); - - // Do check - assertNotNull("resource created", model1.getResouce()); - assertNotNull("resource created", model2.getResouce()); - assertEquals("Resource is shared", model1.getResouce(), model2.getResouce()); - - - } - - /** - * Create and save models. - * - * @throws IOException - * @throws CoreException - */ - private void createAndSave(String model1Key, String model2Key) throws IOException, CoreException { - - FakeModelWithSharedResource model1 = new FakeModelWithSharedResource(ModelKind.master, model1Key, EPackage.class); - FakeModelWithSharedResource model2 = new FakeModelWithSharedResource(model2Key, EClass.class); - - ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); - modelSet.registerModel(model1); - modelSet.registerModel(model2); - - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); - if(!p.exists()) { - p.create(new NullProgressMonitor()); - } - p.open(new NullProgressMonitor()); - - IFile model1File = p.getFile("tmp/model1." + model1Key); - - // Call creates and save - - modelSet.createsModels(model1File); - model1.getResouce().setModified(true); - modelSet.save(new NullProgressMonitor()); - modelSet.unload(); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#loadModel(org.eclipse.core.runtime.IPath)}. - * - * @throws CoreException - * @throws IOException - * @throws ModelMultiException - */ - @Test - public void testLoadModelIPath() throws IOException, CoreException, ModelMultiException { - - - String model1Key = "ecore"; - String model2Key = "genmodel"; - - createAndSave(model1Key, model2Key); - - FakeModelWithSharedResource model1 = new FakeModelWithSharedResource(ModelKind.master, model1Key, EPackage.class); - FakeModelWithSharedResource model2 = new FakeModelWithSharedResource(model2Key, EClass.class); - - ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); - modelSet.registerModel(model1); - modelSet.registerModel(model2); - - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); - - IFile model1File = p.getFile("tmp/model1." + model1Key); - - // Call creates - modelSet.loadModels(model1File); - - // Do check - assertNotNull("resource loaded", model1.getResouce()); - assertNotNull("resource loaded", model2.getResouce()); - assertEquals("Resource is shared", model1.getResouce(), model2.getResouce()); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#saveModel()}. - * - * @throws IOException - * @throws CoreException - */ - @Test - public void testSaveModel() throws IOException, CoreException { - String model1Key = "ecore"; - String model2Key = "genmodel"; - - FakeModelWithSharedResource model1 = new FakeModelWithSharedResource(ModelKind.master, model1Key, EPackage.class); - FakeModelWithSharedResource model2 = new FakeModelWithSharedResource(model2Key, EClass.class); - - ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); - modelSet.registerModel(model1); - modelSet.registerModel(model2); - - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); - if(!p.exists()) { - p.create(new NullProgressMonitor()); - } - p.open(new NullProgressMonitor()); - - IFile model1File = p.getFile("tmp/model1." + model1Key); - - // Call creates and save - - modelSet.createsModels(model1File); - model1.getResouce().setModified(true); - modelSet.save(new NullProgressMonitor()); - - // Do check - assertNotNull("resource created", model1.getResouce()); - assertNotNull("resource created", model2.getResouce()); - assertEquals("Resource is shared", model1.getResouce(), model2.getResouce()); - // Check weither it is save - assertFalse("Resource is saved", model1.getResouce().isModified()); - assertFalse("Resource is saved", model2.getResouce().isModified()); - // TODO : check that it is saved only once ! - - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#getModelRoot()}. - */ - @Test - public void testGetModelRoot() { - String model1Key = "ecore"; - String model2Key = "genmodel"; - - FakeModelWithSharedResource model1 = new FakeModelWithSharedResource(ModelKind.master, model1Key, EPackage.class); - FakeModelWithSharedResource model2 = new FakeModelWithSharedResource(model2Key, EClass.class); - - ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); - modelSet.registerModel(model1); - modelSet.registerModel(model2); - - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); - - IFile model1File = p.getFile("tmp/model1." + model1Key); - - // Call creates - modelSet.createsModels(model1File); - // Add elements in both model - EPackage p1 = EcoreFactory.eINSTANCE.createEPackage(); - model1.addModelRoot(p1); - - EClass c1 = EcoreFactory.eINSTANCE.createEClass(); - model2.addModelRoot(c1); - - // Do check - assertEquals("root found", p1, model1.getModelRoot()); - assertEquals("root found", c1, model2.getModelRoot()); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#getModelRoot()}. - */ - @Test - public void testGetModelRoots() { - String model1Key = "ecore"; - String model2Key = "genmodel"; - - FakeModelWithSharedResource model1 = new FakeModelWithSharedResource(ModelKind.master, model1Key, EPackage.class); - FakeModelWithSharedResource model2 = new FakeModelWithSharedResource(model2Key, EClass.class); - - ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); - modelSet.registerModel(model1); - modelSet.registerModel(model2); - - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); - - IFile model1File = p.getFile("tmp/model1." + model1Key); - - // Call creates - modelSet.createsModels(model1File); - // Add elements in both model - EPackage p1 = EcoreFactory.eINSTANCE.createEPackage(); - model1.addModelRoot(p1); - EPackage p2 = EcoreFactory.eINSTANCE.createEPackage(); - model1.addModelRoot(p2); - EPackage p3 = EcoreFactory.eINSTANCE.createEPackage(); - model1.addModelRoot(p3); - - EClass c1 = EcoreFactory.eINSTANCE.createEClass(); - model2.addModelRoot(c1); - EClass c2 = EcoreFactory.eINSTANCE.createEClass(); - model2.addModelRoot(c2); - EClass c3 = EcoreFactory.eINSTANCE.createEClass(); - model2.addModelRoot(c3); - - // Do check - List lp = model1.getModelRoots(); - List lc = model2.getModelRoots(); - - assertNotNull("list exist", lp); - assertEquals("list size", 3, lp.size()); - assertTrue("element found", lp.contains(p1)); - assertTrue("element found", lp.contains(p2)); - assertTrue("element found", lp.contains(p3)); - - assertNotNull("list exist", lc); - assertEquals("list size", 3, lc.size()); - assertTrue("element found", lc.contains(c1)); - assertTrue("element found", lc.contains(c2)); - assertTrue("element found", lc.contains(c3)); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#addModelRoot(org.eclipse.emf.ecore.EObject)}. - */ - @Test - public void testAddModelRoot() { - String model1Key = "ecore"; - String model2Key = "genmodel"; - - FakeModelWithSharedResource model1 = new FakeModelWithSharedResource(ModelKind.master, model1Key, EPackage.class); - FakeModelWithSharedResource model2 = new FakeModelWithSharedResource(model2Key, EClass.class); - - ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); - modelSet.registerModel(model1); - modelSet.registerModel(model2); - - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); - - IFile model1File = p.getFile("tmp/model1." + model1Key); - - // Call creates - modelSet.createsModels(model1File); - // Add elements in both model - EPackage p1 = EcoreFactory.eINSTANCE.createEPackage(); - model1.addModelRoot(p1); - - EClass c1 = EcoreFactory.eINSTANCE.createEClass(); - model2.addModelRoot(c1); - - // Do check - assertTrue("model contain element", model1.getResouce().getContents().contains(p1)); - assertTrue("model contain element", model2.getResouce().getContents().contains(c1)); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractResourceAdapterTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractResourceAdapterTest.java deleted file mode 100644 index 0803216621e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractResourceAdapterTest.java +++ /dev/null @@ -1,351 +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 482949 - * - */ -package org.eclipse.papyrus.infra.core.resource; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -import java.util.Set; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.resource.impl.ResourceImpl; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.eclipse.papyrus.junit.utils.rules.AbstractHouseKeeperRule.CleanUp; -import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; - -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; - - -/** - * Abstract test suite for the {@link ResourceAdapter} class, providing tests - * for both the base and transactional variants. - */ -public abstract class AbstractResourceAdapterTest extends AbstractPapyrusTest { - - private static final String RESOURCE_ADDED = "handleResourceAdded"; - - private static final String RESOURCE_REMOVED = "handleResourceRemoved"; - - private static final String RESOURCE_LOADED = "handleResourceLoaded"; - - private static final String RESOURCE_UNLOADED = "handleResourceUnloaded"; - - private static final String RESOURCE_URI = "handleResourceURI"; - - private static final String RESOURCE_ROOT_ADDED = "handleRootAdded"; - - private static final String RESOURCE_ROOT_REMOVED = "handleRootRemoved"; - - @Rule - public final HouseKeeper houseKeeper = new HouseKeeper(); - - private T target; - - private ResourceSet rset; - - @CleanUp - private Fixture fixture; - - public AbstractResourceAdapterTest() { - super(); - } - - @Test - public void testResourceAdded() { - Resource res = new ResourceImpl(); - execute(() -> rset.getResources().add(res)); - - fixture.assertHooks(RESOURCE_ADDED); - fixture.assertResources(res); - } - - @Test - public void testResourceRemoved() { - Resource res = new ResourceImpl(); - execute(() -> rset.getResources().add(res)); - - fixture.reset(); - execute(() -> rset.getResources().remove(0)); - - fixture.assertHooks(RESOURCE_REMOVED); - fixture.assertResources(res); - } - - @Test - public void testResourceLoaded() { - Resource res = rset.createResource(getTestResourceURI()); - - fixture.reset(); - safeExecute(() -> res.load(null)); - - fixture.assertHooks(RESOURCE_LOADED); - fixture.assertResources(res); - } - - @Test - public void testResourceUnloaded() { - Resource res = rset.getResource(getTestResourceURI(), true); - - fixture.reset(); - execute(() -> res.unload()); - - fixture.assertHooks(RESOURCE_UNLOADED); - fixture.assertResources(res); - } - - @Test - public void testResourceURI() { - URI oldURI = getTestResourceURI(); - Resource res = rset.getResource(oldURI, true); - - fixture.reset(); - URI newURI = URI.createURI("http:///bogus.ecore"); - execute(() -> res.setURI(newURI)); - - fixture.assertHooks(RESOURCE_URI); - fixture.assertResources(res); - fixture.assertURIs(oldURI, newURI); - } - - @Test - public void testRootAdded() { - Resource res = rset.getResource(getTestResourceURI(), true); - - fixture.reset(); - EObject root = EcoreFactory.eINSTANCE.createEObject(); - execute(() -> res.getContents().add(root)); - - fixture.assertHooks(RESOURCE_ROOT_ADDED); - fixture.assertResources(res); - fixture.assertRoots(root); - } - - @Test - public void testRootRemoved() { - Resource res = rset.getResource(getTestResourceURI(), true); - - fixture.reset(); - EObject root = res.getContents().get(0); - execute(() -> res.getContents().remove(root)); - - fixture.assertHooks(RESOURCE_ROOT_REMOVED); - fixture.assertResources(res); - fixture.assertRoots(root); - } - - @Test - public void testChangesInPreexistingResources_bug481151() { - // Need a different one than the usual, which already has the fixture attached - T newTarget = createTarget(houseKeeper); - ResourceSet newRset = getResourceSet(newTarget); - - // A pre-existing resource - Resource resource = new ResourceImpl(URI.createURI("bogus://test")); - execute(() -> newRset.getResources().add(resource)); - - fixture.install(newTarget); - - // Consequence of initial discovery - fixture.assertHooks(RESOURCE_ADDED); - fixture.reset(); - - EObject newRoot = EcoreFactory.eINSTANCE.createEObject(); - execute(() -> resource.getContents().add(newRoot)); - - // An unloaded resource becomes implicitly loaded when its contents are changed - if (isTransactional()) { - // In the transactional case, all observations are delayed until the end - // of the transaction, so if a resource was loaded during the transaction, - // it doesn't matter what else happened to its contents because we don't - // observe any of those contents until later. So, there is no distinction - // to be had in the additional root-add event, and it isn't observed - fixture.assertHooks(RESOURCE_LOADED); - } else { - // In the non-transactional case, the add happens after load has completed, - // so the resource is no longer loading at that point, and we observe the - // root being added - fixture.assertHooks(RESOURCE_LOADED, RESOURCE_ROOT_ADDED); - } - } - - @Test - public void testUninstallResourceAdapter_bug482949() { - // uninstall now - fixture.uninstall(target); - - // We should not observe any events - Resource res = new ResourceImpl(); - execute(() -> rset.getResources().add(res)); - - fixture.assertHooks(); - fixture.assertResources(); - } - - // - // Test framework - // - - @Before - public void createFixture() { - target = createTarget(houseKeeper); - rset = getResourceSet(target); - fixture = doCreateFixture(); - - fixture.install(target); - houseKeeper.cleanUpLater(fixture, f -> f.uninstall(target)); - } - - protected boolean isTransactional() { - return false; - } - - protected abstract T createTarget(HouseKeeper keeper); - - protected abstract ResourceSet getResourceSet(T target); - - protected abstract void execute(Runnable command); - - protected abstract void safeExecute(RunnableWithException command); - - protected abstract Fixture doCreateFixture(); - - protected final T getTarget() { - return target; - } - - URI getTestResourceURI() { - // Doesn't matter the resource; this one's conveniently available - return URI.createURI(getClass().getResource("Bug402525.ecore").toExternalForm(), true); - } - - // - // Nested types - // - - protected abstract class Fixture { - - private Set resources = Sets.newHashSet(); - - private Set hooksCalled = Sets.newHashSet(); - - private Set roots = Sets.newHashSet(); - - private URI oldURI; - - private URI newURI; - - private A adapter; - - void reset() { - resources.clear(); - hooksCalled.clear(); - roots.clear(); - oldURI = null; - newURI = null; - } - - void assertResources(Resource... resources) { - assertThat(this.resources, is((Set) ImmutableSet.copyOf(resources))); - } - - void assertHooks(String... hooks) { - assertThat(this.hooksCalled, is((Set) ImmutableSet.copyOf(hooks))); - } - - void assertRoots(EObject... objects) { - assertThat(this.roots, is((Set) ImmutableSet.copyOf(objects))); - } - - void assertURIs(URI oldURI, URI newURI) { - assertThat(this.oldURI, is(oldURI)); - assertThat(this.newURI, is(newURI)); - } - - private void called(Resource resource, String hook) { - hooksCalled.add(hook); - resources.add(resource); - } - - private void root(EObject root) { - roots.add(root); - } - - private void uri(URI oldURI, URI newURI) { - this.oldURI = oldURI; - this.newURI = newURI; - } - - protected void handleResourceAdded(Resource resource) { - called(resource, RESOURCE_ADDED); - } - - protected void handleResourceRemoved(Resource resource) { - called(resource, RESOURCE_REMOVED); - } - - protected void handleResourceLoaded(Resource resource) { - called(resource, RESOURCE_LOADED); - } - - protected void handleResourceUnloaded(Resource resource) { - called(resource, RESOURCE_UNLOADED); - } - - protected void handleResourceURI(Resource resource, URI oldURI, URI newURI) { - called(resource, RESOURCE_URI); - uri(oldURI, newURI); - } - - protected void handleRootAdded(Resource resource, EObject root) { - called(resource, RESOURCE_ROOT_ADDED); - root(root); - } - - protected void handleRootRemoved(Resource resource, EObject root) { - called(resource, RESOURCE_ROOT_REMOVED); - root(root); - } - - void install(T target) { - adapter = createAdapter(); - doInstall(adapter, target); - } - - void uninstall(T target) { - if (adapter != null) { - doUninstall(adapter, target); - adapter = null; - } - } - - protected abstract A createAdapter(); - - protected abstract void doInstall(A adapter, T target); - - protected abstract void doUninstall(A adapter, T target); - } - - @FunctionalInterface - protected interface RunnableWithException { - void run() throws Exception; - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/Bug402525.ecore b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/Bug402525.ecore deleted file mode 100644 index 8dea18de3e8..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/Bug402525.ecore +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModel.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModel.java deleted file mode 100644 index 0f6c114bdcd..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModel.java +++ /dev/null @@ -1,67 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011, 2016 LIFL, 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: - * LIFL - Initial API and implementation - * Christian W. Damus - bugs 485220, 488791 - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.resource; - -import org.eclipse.emf.ecore.EObject; - -/** - * @author dumoulin - * - */ -public class FakeModel extends AbstractBaseModel { - - private String identifier; - - public FakeModel(String identifier) { - this.identifier = identifier; - } - - /** - * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getIdentifier() - * - * @return - */ - @Override - public String getIdentifier() { - // TODO Auto-generated method stub - return identifier; - } - - /** - * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getModelFileExtension() - * - * @return - */ - @Override - protected String getModelFileExtension() { - // TODO Auto-generated method stub - return identifier; - } - - @Override - public boolean canPersist(EObject object) { - return false; - } - - @Override - public void persist(EObject object) { - throw new IllegalArgumentException("cannot persist " + object); //$NON-NLS-1$ - } - - // Overridden to make it accessible - @Override - protected ModelSet getModelManager() { - return super.getModelManager(); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelManagerSnippet.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelManagerSnippet.java deleted file mode 100644 index fc3a550811d..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelManagerSnippet.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.infra.core.resource; - - - -/** - * a fake {@link IModelSetSnippet} for test purpose. - * - * @author cedric dumoulin - * - */ -public class FakeModelManagerSnippet implements IModelSetSnippet { - - private TestTrace trace; - - private String name; - - /** - * - * Constructor. - * - * @param string - */ - public FakeModelManagerSnippet(String name) { - this.trace = new TestTrace(); - this.name = name; - } - - /** - * - * Constructor. - * - * @param trace2 - * @param string - */ - public FakeModelManagerSnippet(TestTrace trace, String name) { - this.trace = trace; - this.name = name; - } - - /** - * @see org.eclipse.papyrus.infra.core.resource.IModelSetSnippet#start(org.eclipse.papyrus.infra.core.resource.ModelSet) - * - * @param modelsManager - */ - public void start(ModelSet modelsManager) { - trace.addTrace(name, "start"); - } - - /** - * @see org.eclipse.papyrus.infra.core.resource.IModelSetSnippet#dispose(org.eclipse.papyrus.infra.core.resource.ModelSet) - * - * @param modelsManager - */ - public void dispose(ModelSet modelsManager) { - trace.addTrace(name, "dispose"); - - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelWithSharedResource.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelWithSharedResource.java deleted file mode 100644 index c2ec36169ba..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelWithSharedResource.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.infra.core.resource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; - - -/** - * @author dumoulin - * - */ -public class FakeModelWithSharedResource extends AbstractModelWithSharedResource { - - private String identifier; - private String fileExtension; - private Class expectedType; - - /** - * - * Constructor. - * - * @param kind - * @param identifier - * @param fileExtension - * @param expectedType - */ - public FakeModelWithSharedResource(ModelKind kind, String identifier, String fileExtension, Class expectedType) { - super(kind); - this.identifier = identifier; - this.expectedType = expectedType; - this.fileExtension = fileExtension; - } - - /** - * - * Constructor. - * - * @param kind - * @param identifier - * @param expectedType - */ - public FakeModelWithSharedResource(ModelKind kind, String identifier, Class expectedType) { - this(kind, identifier, "di", expectedType); - } - - /** - * - * Constructor. - * - * @param identifier - * @param expectedType - */ - public FakeModelWithSharedResource(String identifier, Class expectedType) { - this(ModelKind.slave, identifier, expectedType); - } - - /** - * - * @see org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#isModelRoot(org.eclipse.emf.ecore.EObject) - * - * @param object - * @return - */ - @Override - protected boolean isModelRoot(EObject object) { - return expectedType.isInstance(object); - } - - /** - * - * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getIdentifier() - * - * @return - */ - @Override - public String getIdentifier() { - return identifier; - } - - /** - * - * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getModelFileExtension() - * - * @return - */ - @Override - protected String getModelFileExtension() { - return fileExtension; - } - - /** - * Get the associated resource. - * @return - */ - public Resource getResouce() { - return resource; - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ModelSetTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ModelSetTest.java deleted file mode 100644 index d06b7d25e1c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ModelSetTest.java +++ /dev/null @@ -1,691 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010, 2015 LIFL, 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: - * LIFL - Initial API and implementation - * Christian W. Damus (CEA) - bug 422257 - * Christian W. Damus (CEA) - bug 436047 - * Christian W. Damus (CEA) - bug 437052 - * Christian W. Damus - bug 481149 - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.resource; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.util.Set; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -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.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.edit.command.SetCommand; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.papyrus.infra.core.resource.additional.AdditionalResourcesModel; -import org.eclipse.papyrus.infra.core.utils.TransactionHelper; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.eclipse.papyrus.junit.utils.ModelUtils; -import org.eclipse.papyrus.junit.utils.resources.EcoreModel; -import org.eclipse.papyrus.junit.utils.resources.WorkspaceModificationAssertion; -import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; - -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; - -/** - * Test for {@link ModelSet}.
- * Run as "JUnit Plugin-Test" - * - * @author cedric dumoulin - * - */ -public class ModelSetTest extends AbstractPapyrusTest { - - /** - * Name of the plugin that is created. - */ - final protected String PLUGIN_PROJECT_NAME = "org.eclipse.papyrus.infra.core"; - - @Rule - public final HouseKeeper houseKeeper = new HouseKeeper(); - - /** - * - * @throws Exception - */ - @Before - public void setUp() throws Exception { - } - - /** - * - * @throws Exception - */ - @After - public void tearDown() throws Exception { - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet.registerModel(IModel)} . - */ - @Test - public void testRegisterModel() { - ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); - - FakeModel model1 = new FakeModel("model1"); - - mngr.registerModel(model1); - - assertNotNull("mngr is set", model1.getModelManager()); - assertNotNull("model is registered", mngr.getModel("model1")); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#getModel(String)} . - */ - @Test - public void testGetModel() { - ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); - - FakeModel model1 = new FakeModel("model1"); - FakeModel model2 = new FakeModel("model2"); - - mngr.registerModel(model1); - mngr.registerModel(model2); - - assertNotNull("model is registered", mngr.getModel("model1")); - assertNotNull("model is registered", mngr.getModel("model2")); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#getTransactionalEditingDomain()} . - */ - @Test - public void testGetTransactionalEditingDomain() { - ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); - - assertNotNull("editing domain created", mngr.getTransactionalEditingDomain()); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#createsModels(IFile)} . - */ - @Test - public void testCreatesModels() throws IOException, CoreException { - ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); - - String model1Key = "ecore"; - String model2Key = "genmodel"; - - FakeModel model1 = new FakeModel(model1Key); - FakeModel model2 = new FakeModel(model2Key); - - mngr.registerModel(model1); - mngr.registerModel(model2); - - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); - - IFile model1File = p.getFile("tmp/model1." + model1Key); - - // Do create - mngr.createsModels(model1File); - - assertNotNull("resource created", model1.getResource()); - assertNotNull("resource created", model2.getResource()); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#loadModels(IFile)} . - * - * @throws ModelMultiException - */ - @Test - public void testLoadModels() throws IOException, CoreException, ModelMultiException { - - // Create models so they exists - testSave(); - - // Now do load - ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); - - String model1Key = "ecore"; - String model2Key = "genmodel"; - - FakeModel model1 = new FakeModel(model1Key); - FakeModel model2 = new FakeModel(model2Key); - - mngr.registerModel(model1); - mngr.registerModel(model2); - - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); - - IFile model1File = p.getFile("tmp/model1." + model1Key); - IFile model2File = p.getFile("tmp/model1." + model2Key); - - assertTrue("modelFile exist", model1File.exists()); - assertTrue("modelFile exist", model2File.exists()); - - // Try to load - mngr.loadModels(model1File); - - assertNotNull("resource created", model1.getResource()); - assertNotNull("resource created", model2.getResource()); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#save(IProgressMonitor)} . - */ - @Test - public void testSave() throws CoreException, IOException { - ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); - - String model1Key = "ecore"; - String model2Key = "genmodel"; - - FakeModel model1 = new FakeModel(model1Key); - FakeModel model2 = new FakeModel(model2Key); - - mngr.registerModel(model1); - mngr.registerModel(model2); - - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); - if (!p.exists()) { - p.create(new NullProgressMonitor()); - } - p.open(new NullProgressMonitor()); - - IFile model1File = p.getFile("tmp/model1." + model1Key); - IFile model2File = p.getFile("tmp/model1." + model2Key); - - // Do create and save - mngr.createsModels(model1File); - mngr.save(new NullProgressMonitor()); - // - assertTrue("resource created", model1File.exists()); - assertTrue("resource created", model2File.exists()); - // - assertNotNull("resource created", model1.getResource()); - assertNotNull("resource created", model2.getResource()); - } - - /** - * Tests that only modified resources are saved, where we have only one model (no referenced libraries). - */ - @Test - public void testSave_onlyModifiedResources1() throws Exception { - ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); - TransactionalEditingDomain domain = houseKeeper.cleanUpLater(mngr.getTransactionalEditingDomain()); - - EcoreModel model = new EcoreModel(); - - mngr.registerModel(model); - mngr.registerModel(new AdditionalResourcesModel()); - - IProject p = houseKeeper.createProject(houseKeeper.getTestName()); - - final IFile modelFile = p.getFile("model1." + model.getModelFileExtension()); - final URI modelURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true); - - final WorkspaceModificationAssertion mods = new WorkspaceModificationAssertion(houseKeeper); - - mngr.createModels(modelURI); - mods.save(mngr); - - assertThat("workspace resource not created", modelFile.exists(), is(true)); - - assertThat("EMF resource is null", model.getResource(), notNullValue()); - assertThat("EMF resource not created", model.getResource().getContents().isEmpty(), is(false)); - - EPackage ePackage = model.getRoot(); - domain.getCommandStack().execute(SetCommand.create(domain, ePackage, EcorePackage.Literals.ENAMED_ELEMENT__NAME, "newname")); - - mods.requireChange(modelURI); - mods.save(mngr); - - // Saving again should have no effect on the workspace - mods.requireNoChange(modelURI); - mods.save(mngr); - } - - /** - * Tests that only modified resources are saved, where we have multiple models (referenced libraries). - */ - @Test - public void testSave_onlyModifiedResources2() throws Exception { - ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); - TransactionalEditingDomain domain = houseKeeper.cleanUpLater(mngr.getTransactionalEditingDomain()); - - final EcoreModel model = new EcoreModel(); - - mngr.registerModel(model); - mngr.registerModel(new AdditionalResourcesModel()); - - IProject p = houseKeeper.createProject(houseKeeper.getTestName()); - - final IFile modelFile1 = p.getFile("model1." + model.getModelFileExtension()); - final URI modelURI1 = URI.createPlatformResourceURI(modelFile1.getFullPath().toString(), true); - - final IFile modelFile2 = p.getFile("model2." + model.getModelFileExtension()); - final URI modelURI2 = URI.createPlatformResourceURI(modelFile2.getFullPath().toString(), true); - - final WorkspaceModificationAssertion mods = new WorkspaceModificationAssertion(houseKeeper); - - mngr.createModels(modelURI1); - - // Set up a second model and a dependency from the first - final Resource res2 = mngr.createResource(modelURI2, EcorePackage.eCONTENT_TYPE); - TransactionHelper.run(domain, new Runnable() { - - public void run() { - EPackage ePackage = EcoreFactory.eINSTANCE.createEPackage(); - ePackage.setName("library"); - ePackage.setNsPrefix("lib"); - ePackage.setNsURI("http://www.eclipse.org/papyrus/test/fakemodel/ecore/library"); - res2.getContents().add(ePackage); - - // A class in the library model - EClass foo = EcoreFactory.eINSTANCE.createEClass(); - foo.setName("Foo"); - ePackage.getEClassifiers().add(foo); - - // A class in the main model - EClass thing = EcoreFactory.eINSTANCE.createEClass(); - thing.setName("Thing"); - model.getRoot().getEClassifiers().add(thing); - - EReference reference = EcoreFactory.eINSTANCE.createEReference(); - reference.setName("foo"); - reference.setEType(foo); - thing.getEStructuralFeatures().add(reference); - } - }); - - // We need this referenced model to be writable in order to save it - ModelUtils.makeReferencedModelsWritable(mngr, modelURI2); - mods.save(mngr); - - assertThat("workspace resource not created", modelFile1.exists(), is(true)); - assertThat("workspace resource not created", modelFile2.exists(), is(true)); - - assertThat("EMF resource is null", model.getResource(), notNullValue()); - assertThat("EMF resource not created", model.getResource().getContents().isEmpty(), is(false)); - assertThat("EMF resource not created", res2.getContents().isEmpty(), is(false)); - - // Change the referenced resource's URI. This should make the resource and its dependents dirty - final URI modelURI2New = modelURI2.trimSegments(1).appendSegment("library1").appendFileExtension(model.getModelFileExtension()); - res2.setURI(modelURI2New); - - ModelUtils.makeReferencedModelsWritable(mngr, modelURI2New); - mods.requireChange(modelURI1); // Thanks to the ProxyModificationTrackingAdapter - mods.requireChange(modelURI2New); - mods.requireNoChange(modelURI2); // No longer an interesting URI - mods.save(mngr); - - EPackage ePackage = model.getRoot(); - domain.getCommandStack().execute(SetCommand.create(domain, ePackage, EcorePackage.Literals.ENAMED_ELEMENT__NAME, "newname")); - - // Saving this should have no effect on the second resource - mods.requireChange(modelURI1); - mods.requireNoChange(modelURI2New); - mods.requireNoChange(modelURI2); - mods.save(mngr); - } - - /** - * Create some Resources for other test. This method should be called explicitly. - * - * @throws CoreException - * @throws IOException - */ - protected void createResources(String... filenames) throws CoreException, IOException { - - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(PLUGIN_PROJECT_NAME); - if (!p.exists()) { - p.create(new NullProgressMonitor()); - } - p.open(new NullProgressMonitor()); - - ResourceSet resourceSet = houseKeeper.createResourceSet(); - - for (String filename : filenames) { - createResource(p, resourceSet, filename); - } - - // Save created resources - for (Resource resource : resourceSet.getResources()) { - resource.save(null); - } - } - - - /** - * Create a resource. - * - * @param p - * @param resourceSet - * @param filename - */ - private void createResource(IProject p, ResourceSet resourceSet, String filename) { - - // Build a valid file - IFile file = p.getFile(filename); - - - URI uri = URI.createPlatformResourceURI(file.getFullPath().toOSString(), true); - resourceSet.createResource(uri); - - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#saveAs(IPath)} . - */ - @Test - public void testSaveAs() throws CoreException, IOException { - ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); - - String model1Key = "ecore"; - String model2Key = "genmodel"; - - FakeModel model1 = new FakeModel(model1Key); - FakeModel model2 = new FakeModel(model2Key); - - mngr.registerModel(model1); - mngr.registerModel(model2); - - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); - if (!p.exists()) { - p.create(new NullProgressMonitor()); - } - p.open(new NullProgressMonitor()); - - IFile model1File = p.getFile("tmp/model1." + model1Key); - - // Do create and save - mngr.createsModels(model1File); - mngr.save(new NullProgressMonitor()); - - // Change the name - IFile newModel1File = p.getFile("tmp/model2." + model1Key); - IFile newModel2File = p.getFile("tmp/model2." + model2Key); - IPath newPath = newModel1File.getFullPath(); - - mngr.saveAs(newPath); - // check creation - - assertTrue("resource created", newModel2File.exists()); - assertTrue("resource created", newModel2File.exists()); - // - assertNotNull("resource created", model1.getResource()); - assertNotNull("resource created", model2.getResource()); - - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#unload()} . - */ - @Test - public void testUnload() { - ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); - - String model1Key = "ecore"; - String model2Key = "genmodel"; - - FakeModel model1 = new FakeModel(model1Key); - FakeModel model2 = new FakeModel(model2Key); - - mngr.registerModel(model1); - mngr.registerModel(model2); - - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); - - IFile model1File = p.getFile("tmp/model1." + model1Key); - - // Do create and then unload - mngr.createsModels(model1File); - mngr.unload(); - - assertNull("resource unloaded", model1.getResource()); - assertNull("resource unloaded", model2.getResource()); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#addModelSetSnippet(IModelManagerSnippet)} . - */ - @Test - public void testAddModelSetSnippet() { - ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); - - // Add snippets - TestTrace trace = new TestTrace(); - mngr.addModelSetSnippet(new FakeModelManagerSnippet(trace, "snippet1")); - mngr.addModelSetSnippet(new FakeModelManagerSnippet(trace, "snippet2")); - - // Do create - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); - IFile model1File = p.getFile("tmp/model1.ecore"); - mngr.createsModels(model1File); - - // Check calls - assertTrue("snippet1 called", trace.contains("snippet1", "start")); - assertTrue("snippet2 called", trace.contains("snippet2", "start")); - - } - - /** - * Test that snippets are called after a call to createsModels() - */ - @Test - public void testSnippetCalledAfterCreateModels() { - ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); - - // Add snippets - TestTrace trace = new TestTrace(); - mngr.addModelSetSnippet(new FakeModelManagerSnippet(trace, "snippet1")); - mngr.addModelSetSnippet(new FakeModelManagerSnippet(trace, "snippet2")); - - // Do create - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); - IFile model1File = p.getFile("tmp/model1.ecore"); - mngr.createsModels(model1File); - - // Check calls - assertTrue("snippet1 called", trace.contains("snippet1", "start")); - assertTrue("snippet2 called", trace.contains("snippet2", "start")); - - // dispose - mngr.unload(); - // Check calls - assertTrue("snippet1 called", trace.contains("snippet1", "dispose")); - assertTrue("snippet2 called", trace.contains("snippet2", "dispose")); - - } - - /** - * Test that snippets are called after a call to loadModels() - * - * @throws ModelMultiException - */ - @Test - public void testSnippetCalledAfterLoadModels() throws ModelMultiException { - - // force model creation - testSnippetCalledAfterCreateModels(); - - // now do load. - ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); - - // Add snippets - TestTrace trace = new TestTrace(); - mngr.addModelSetSnippet(new FakeModelManagerSnippet(trace, "snippet1")); - mngr.addModelSetSnippet(new FakeModelManagerSnippet(trace, "snippet2")); - - // Do create - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); - IFile model1File = p.getFile("tmp/model1.ecore"); - mngr.loadModels(model1File); - - // Check calls - assertTrue("snippet1 called", trace.contains("snippet1", "start")); - assertTrue("snippet2 called", trace.contains("snippet2", "start")); - - // dispose - mngr.unload(); - // Check calls - assertTrue("snippet1 called", trace.contains("snippet1", "dispose")); - assertTrue("snippet2 called", trace.contains("snippet2", "dispose")); - - } - - /** - * Test {@link #createResources(String...)}. This is a test methods :-) - * - * @throws ModelMultiException - */ - @Test - public void testCreateResource() throws IOException, CoreException, ModelMultiException { - - String model1Key = "ecore"; - String model2Key = "genmodel"; - String model3Key = "uml"; - - // Create models - createResources("tmp/model1." + model1Key, "tmp/model1." + model2Key, "tmp/model1." + model3Key); - - // Check model creation - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(PLUGIN_PROJECT_NAME); - - IFile model1File = p.getFile("tmp/model1." + model1Key); - IFile model2File = p.getFile("tmp/model1." + model2Key); - IFile model3File = p.getFile("tmp/model1." + model3Key); - - assertTrue("modelFile exist", model1File.exists()); - assertTrue("modelFile exist", model2File.exists()); - assertTrue("modelFile exist", model3File.exists()); - } - - /** - * Test {@link ModelSet#importModels(ModelIdentifiers, IFile)} called after {@link ModelSet#createsModels(IFile)} . - * - * @throws ModelException - */ - @Test - public void testImportAfterCreate() throws IOException, CoreException, ModelException { - - String model1Key = "ecore"; - String model2Key = "genmodel"; - String model3Key = "uml"; - - // Create models - createResources("tmp/model1." + model1Key, "tmp/model1." + model2Key, "tmp/model1." + model3Key); - - // Now do registration - ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); - - FakeModel model1 = new FakeModel(model1Key); - FakeModel model2 = new FakeModel(model2Key); - FakeModel model3 = new FakeModel(model3Key); - - mngr.registerModel(model1); - mngr.registerModel(model2); - mngr.registerModel(model3); - - - // Get an handle on one of the files - IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(PLUGIN_PROJECT_NAME); - IFile createdFile = p.getFile("tmp/model2." + model1Key); - - - // Try to create all models - mngr.createsModels(createdFile); - - assertNotNull("resource created", model1.getResource()); - assertNotNull("resource created", model2.getResource()); - assertNotNull("resource created", model3.getResource()); - - // Add something in the model - model1.getResource().getContents().add(EcoreFactory.eINSTANCE.createEPackage()); - assertEquals("model1 has changed", 1, model1.getResource().getContents().size()); - - // Try to import - IFile importFile = p.getFile("tmp/model1." + model1Key); - mngr.importModels(new ModelIdentifiers(model1Key, model2Key), importFile); - - assertNotNull("resource exist", model1.getResource()); - assertNotNull("resource exist", model2.getResource()); - assertNotNull("resource exist", model3.getResource()); - - assertEquals("model1 has changed", 0, model1.getResource().getContents().size()); - - - } - - /** - * Tests that model snippets are started if added to a model after it has loaded. - */ - @Test - public void testStartLateSnippet_bug481149() throws IOException, CoreException, ModelMultiException { - ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); - - String model1Key = "ecore"; - String model2Key = "genmodel"; - - FakeModel model1 = new FakeModel(model1Key); - FakeModel model2 = new FakeModel(model2Key); - - modelSet.registerModel(model1); - modelSet.registerModel(model2); - - class TestSnippet implements IModelSnippet { - Set active = Sets.newHashSet(); - - public void start(IModel startingModel) { - active.add(startingModel); - } - - public void dispose(IModel stoppingModel) { - active.remove(stoppingModel); - } - } - - TestSnippet earlySnippet = new TestSnippet(); - TestSnippet lateSnippet = new TestSnippet(); - - model1.addModelSnippet(earlySnippet); - model2.addModelSnippet(earlySnippet); - - modelSet.createModels(URI.createURI("bogus://test")); - - model1.addModelSnippet(lateSnippet); - model2.addModelSnippet(lateSnippet); - - assertThat(earlySnippet.active, is((Set) ImmutableSet. of(model1, model2))); - assertThat(lateSnippet.active, is((Set) ImmutableSet. of(model1, model2))); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/NestingTransactionalCommandStackTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/NestingTransactionalCommandStackTest.java deleted file mode 100644 index bd747b966a0..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/NestingTransactionalCommandStackTest.java +++ /dev/null @@ -1,514 +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.infra.core.resource; - -import static org.hamcrest.CoreMatchers.both; -import static org.hamcrest.CoreMatchers.hasItem; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.hamcrest.CoreMatchers.sameInstance; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.fail; - -import java.net.URL; -import java.util.concurrent.Callable; - -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.ENamedElement; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.emf.ecore.EcorePackage; -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.provider.ComposedAdapterFactory; -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.emf.transaction.TransactionalCommandStack; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.hamcrest.BaseMatcher; -import org.hamcrest.Description; -import org.hamcrest.Matcher; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import com.google.common.base.Objects; - - -/** - * Test suite for the {@link NestingTransactionalCommandStack} class. - */ -public class NestingTransactionalCommandStackTest extends AbstractPapyrusTest { - - // No API signatures but the most basic are required for nesting - private CommandStack fixture; - - private TransactionalEditingDomain domain; - - private ResourceSet rset; - - private EPackage testPackage; - - private EClass foo; - - public NestingTransactionalCommandStackTest() { - super(); - } - - // - // Test cases - // - - @Test - public void testCompleteUnnestedCommand() { - Callable createAttribute = createAttribute(); - - int oldFeatureCount = foo.getEStructuralFeatures().size(); - - // Create two attributes - EAttribute attr1 = execute(createAttribute); - EAttribute attr2 = execute(createAttribute); - assertThat(foo.getEStructuralFeatures().size(), is(oldFeatureCount + 2)); - assertThat(foo.getEStructuralFeatures(), hasItem(attr1)); - assertThat(foo.getEStructuralFeatures(), hasItem(attr2)); - - // Undo only undoes one of them - Command undone = undo(); - assertThat(foo.getEStructuralFeatures().size(), is(oldFeatureCount + 1)); - assertThat(foo.getEStructuralFeatures(), hasItem(attr1)); - assertThat(foo.getEStructuralFeatures(), not(hasItem(attr2))); - - // Redo is sane - Command redone = redo(); - assertThat(redone, sameInstance(undone)); - assertThat(foo.getEStructuralFeatures().size(), is(oldFeatureCount + 2)); - assertThat(foo.getEStructuralFeatures(), hasItem(attr1)); - assertThat(foo.getEStructuralFeatures(), hasItem(attr2)); - } - - @Test - public void testCancelUnnestedCommand() { - Callable createAttribute = createAttribute(2); - - int oldFeatureCount = foo.getEStructuralFeatures().size(); - - // Try to create two attributes (second one cancels) - EAttribute attr1 = execute(createAttribute); - EAttribute attr2 = execute(createAttribute); - assertThat(attr2, nullValue()); - assertThat(foo.getEStructuralFeatures().size(), is(oldFeatureCount + 1)); - assertThat(foo.getEStructuralFeatures(), hasItem(attr1)); - assertThat(foo.getEStructuralFeature("attribute2"), nullValue()); //$NON-NLS-1$ - - // Undo is sane - Command undone = undo(); - assertThat(foo.getEStructuralFeatures().size(), is(oldFeatureCount)); - assertThat(foo.getEStructuralFeatures(), not(hasItem(attr1))); - assertThat(foo.getEStructuralFeature("attribute2"), nullValue()); //$NON-NLS-1$ - - // Redo is sane - Command redone = redo(); - assertThat(redone, sameInstance(undone)); - assertThat(foo.getEStructuralFeatures().size(), is(oldFeatureCount + 1)); - assertThat(foo.getEStructuralFeatures(), hasItem(attr1)); - assertThat(foo.getEStructuralFeature("attribute2"), nullValue()); //$NON-NLS-1$ - } - - @Test - public void testCompleteNestedCommand() { - final int FEATURES = 2; - Callable createClass = createClass(FEATURES); - - int oldClassifierCount = testPackage.getEClassifiers().size(); - - EClass clas = execute(createClass); - assertThat(testPackage.getEClassifiers().size(), is(oldClassifierCount + 1)); - assertThat(testPackage.getEClassifiers(), hasItem(clas)); - assertThat(clas.getEStructuralFeatures().size(), is(FEATURES)); - assertThat(clas.getEStructuralFeature("attribute1"), notNullValue()); //$NON-NLS-1$ - assertThat(clas.getEStructuralFeature("attribute2"), notNullValue()); //$NON-NLS-1$ - - // Undo is sane and there is only one command to undo - Command undone = undo(); - assertThat(fixture.canUndo(), is(false)); - assertThat(testPackage.getEClassifiers().size(), is(oldClassifierCount)); - assertThat(testPackage.getEClassifiers(), not(hasItem(clas))); - - // Redo is sane - Command redone = redo(); - assertThat(redone, sameInstance(undone)); - assertThat(testPackage.getEClassifiers().size(), is(oldClassifierCount + 1)); - assertThat(testPackage.getEClassifiers(), hasItem(clas)); - assertThat(clas.getEStructuralFeatures().size(), is(FEATURES)); - assertThat(clas.getEStructuralFeature("attribute1"), notNullValue()); //$NON-NLS-1$ - assertThat(clas.getEStructuralFeature("attribute2"), notNullValue()); //$NON-NLS-1$ - } - - @Test - public void testCancelNestedCommand() { - final int FEATURES = 2; - Callable createClass = createClass(FEATURES, 2, FEATURES); - - int oldClassifierCount = testPackage.getEClassifiers().size(); - - // Try to create two classes (second one cancels) - EClass class1 = execute(createClass); - EClass class2 = execute(createClass); - assertThat(class2, nullValue()); - assertThat(testPackage.getEClassifiers().size(), is(oldClassifierCount + 1)); - assertThat(testPackage.getEClassifiers(), hasItem(class1)); - assertThat(class1.getEStructuralFeatures().size(), is(FEATURES)); - assertThat(class1.getEStructuralFeature("attribute1"), notNullValue()); //$NON-NLS-1$ - assertThat(class1.getEStructuralFeature("attribute2"), notNullValue()); //$NON-NLS-1$ - - // Undo is sane and there is only one command to undo - Command undone = undo(); - assertThat(fixture.canUndo(), is(false)); - assertThat(testPackage.getEClassifiers().size(), is(oldClassifierCount)); - assertThat(testPackage.getEClassifiers(), not(hasItem(class1))); - - // Redo is sane - Command redone = redo(); - assertThat(redone, sameInstance(undone)); - assertThat(testPackage.getEClassifiers().size(), is(oldClassifierCount + 1)); - assertThat(testPackage.getEClassifiers(), hasItem(class1)); - assertThat(class1.getEStructuralFeatures().size(), is(FEATURES)); - assertThat(class1.getEStructuralFeature("attribute1"), notNullValue()); //$NON-NLS-1$ - assertThat(class1.getEStructuralFeature("attribute2"), notNullValue()); //$NON-NLS-1$ - } - - @Test - public void testCompleteTripleNestedCommand() { - final int CLASSES = 2; - final int FEATURES = 2; - - Callable createPackage = createPackage(CLASSES, FEATURES); - - int oldPackageCount = testPackage.getESubpackages().size(); - - EPackage pkg = execute(createPackage); - assertThat(testPackage.getESubpackages().size(), is(oldPackageCount + 1)); - assertThat(testPackage.getESubpackages(), hasItem(pkg)); - assertThat(pkg.getEClassifiers().size(), is(CLASSES)); - assertThat(pkg.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class1")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - assertThat(pkg.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class2")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - - // Undo is sane and there is only one command to undo - Command undone = undo(); - assertThat(fixture.canUndo(), is(false)); - assertThat(testPackage.getESubpackages().size(), is(oldPackageCount)); - assertThat(testPackage.getESubpackages(), not(hasItem(pkg))); - assertThat(pkg.getName(), nullValue()); - assertThat(pkg.getEClassifiers().size(), is(0)); - assertThat(pkg.getEClassifiers().size(), is(0)); - - // Redo is sane - Command redone = redo(); - assertThat(redone, sameInstance(undone)); - assertThat(fixture.canRedo(), is(false)); - assertThat(testPackage.getESubpackages().size(), is(oldPackageCount + 1)); - assertThat(testPackage.getESubpackages(), hasItem(pkg)); - assertThat(pkg, named("package1")); //$NON-NLS-1$ - assertThat(pkg.getEClassifiers().size(), is(CLASSES)); - assertThat(pkg.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class1")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - assertThat(pkg.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class2")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } - - @Test - public void testCancelTripleNestedCommand() { - final int CLASSES = 2; - final int FEATURES = 2; - - Callable createPackage = createPackage(CLASSES, FEATURES, 2, CLASSES, FEATURES); - - int oldPackageCount = testPackage.getESubpackages().size(); - - // Try to create two packages (second one cancels) - EPackage pkg1 = execute(createPackage); - EPackage pkg2 = execute(createPackage); - - // the first package is complete - assertThat(testPackage.getESubpackages().size(), is(oldPackageCount + 1)); - assertThat(testPackage.getESubpackages(), hasItem(pkg1)); - assertThat(pkg1, named("package1")); //$NON-NLS-1$ - assertThat(pkg1.getEClassifiers().size(), is(CLASSES)); - assertThat(pkg1.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class1")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - assertThat(pkg1.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class2")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - - // there is no second package - assertThat(pkg2, nullValue()); - - // Undo is sane and there is only one command to undo - Command undone = undo(); - assertThat(fixture.canUndo(), is(false)); - assertThat(testPackage.getESubpackages().size(), is(oldPackageCount)); - assertThat(testPackage.getESubpackages(), not(hasItem(pkg1))); - assertThat(pkg1.getName(), nullValue()); - assertThat(pkg1.getEClassifiers().size(), is(0)); - - // Redo is sane - Command redone = redo(); - assertThat(fixture.canRedo(), is(false)); - assertThat(redone, sameInstance(undone)); - assertThat(testPackage.getESubpackages().size(), is(oldPackageCount + 1)); - assertThat(testPackage.getESubpackages(), hasItem(pkg1)); - assertThat(pkg1, named("package1")); //$NON-NLS-1$ - assertThat(pkg1.getEClassifiers().size(), is(CLASSES)); - assertThat(pkg1.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class1")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - assertThat(pkg1.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class2")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } - - // - // Test framework - // - - @Before - public void createFixture() { - rset = new ResourceSetImpl(); - fixture = new NestingTransactionalCommandStack(); - AdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); - domain = new TransactionalEditingDomainImpl(adapterFactory, (TransactionalCommandStack)fixture, rset); - - URL testModelURL = getClass().getResource("Bug402525.ecore"); //$NON-NLS-1$ - Resource testModel = rset.getResource(URI.createURI(testModelURL.toExternalForm(), true), true); - testPackage = (EPackage)testModel.getContents().get(0); - foo = (EClass)testPackage.getEClassifier("Foo"); //$NON-NLS-1$ - } - - @After - public void destroyFixture() { - // This disposes the command stack for us - domain.dispose(); - domain = null; - fixture = null; - - dispose(rset); - rset = null; - } - - void dispose(ResourceSet rset) { - for(Resource next : rset.getResources()) { - next.unload(); - next.eAdapters().clear(); - } - - rset.getResources().clear(); - rset.eAdapters().clear(); - } - - V execute(final Callable operation) { - class TestCommand extends RecordingCommand { - - V result; - - TestCommand() { - super(domain); - } - - @Override - protected void doExecute() { - try { - result = operation.call(); - } catch (OperationCanceledException e) { - // Pass it on - throw e; - } catch (Exception e) { - e.printStackTrace(); - fail("Uncaught exception in operation: " + e.getLocalizedMessage()); //$NON-NLS-1$ - } - } - } - - TestCommand command = new TestCommand(); - fixture.execute(command); - return command.result; - } - - Command undo() { - assertThat("Cannot undo", fixture.canUndo()); //$NON-NLS-1$ - Command result = fixture.getUndoCommand(); - fixture.undo(); - return result; - } - - Command redo() { - assertThat("Cannot redo", fixture.canRedo()); //$NON-NLS-1$ - Command result = fixture.getRedoCommand(); - fixture.redo(); - return result; - } - - Callable createAttribute() { - return createAttribute(0); - } - - Callable createAttribute(int cancelOn) { - return createAttribute(foo, cancelOn); - } - - Callable createAttribute(final EClass owner, final int cancelOn) { - return new Callable() { - - int i = 0; - - public EAttribute call() throws Exception { - String name = nextName(); - - EAttribute attr = EcoreFactory.eINSTANCE.createEAttribute(); - owner.getEStructuralFeatures().add(attr); - attr.setName(name); - attr.setEType(EcorePackage.Literals.ESTRING); - - checkCancel(); - - return attr; - } - - private String nextName() { - i = i + 1; - return "attribute" + i; //$NON-NLS-1$ - } - - private void checkCancel() { - if(i == cancelOn) { - throw new OperationCanceledException(); - } - } - }; - } - - Callable createClass(int attributes) { - return createClass(attributes, 0, 0); - } - - Callable createClass(int attributes, int cancelOn, int cancelAttributesOn) { - return createClass(testPackage, attributes, cancelOn, cancelAttributesOn); - } - - Callable createClass(final EPackage owner, final int attributes, final int cancelOn, final int cancelAttributesOn) { - return new Callable() { - - int i = 0; - - public EClass call() throws Exception { - String name = nextName(); - - EClass clas = EcoreFactory.eINSTANCE.createEClass(); - owner.getEClassifiers().add(clas); - clas.setName(name); - - Callable createAttribute = createAttribute(clas, checkCancelAttributes()); - for(int i = 0; i < attributes; i++) { - // Nested command - execute(createAttribute); - } - - return clas; - } - - private String nextName() { - i = i + 1; - return "Class" + i; //$NON-NLS-1$ - } - - private int checkCancelAttributes() { - return (i == cancelOn) ? cancelAttributesOn : 0; - } - }; - } - - Callable createPackage(int classes, int attributes) { - return createPackage(classes, attributes, 0, 0, 0); - } - - Callable createPackage(final int classes, final int attributes, final int cancelOn, final int cancelClassesOn, final int cancelAttributesOn) { - return new Callable() { - - int i = 0; - - public EPackage call() throws Exception { - String name = nextName(); - - EPackage pkg = EcoreFactory.eINSTANCE.createEPackage(); - testPackage.getESubpackages().add(pkg); - pkg.setName(name); - - Callable createClass = createClass(pkg, attributes, checkCancelClasses(), cancelAttributesOn); - for(int i = 0; i < classes; i++) { - // Nested command - execute(createClass); - } - - return pkg; - } - - private String nextName() { - i = i + 1; - return "package" + i; //$NON-NLS-1$ - } - - private int checkCancelClasses() { - return (i == cancelOn) ? cancelClassesOn : 0; - } - }; - } - - Matcher named(final String name) { - return new BaseMatcher() { - - public void describeTo(Description desc) { - desc.appendText("is named \"").appendValue(name).appendText("\""); //$NON-NLS-1$ //$NON-NLS-2$ - } - - public boolean matches(Object o) { - return (o instanceof ENamedElement) && Objects.equal(((ENamedElement)o).getName(), name); - } - }; - } - - Matcher featureCount(final int count) { - return new BaseMatcher() { - - public void describeTo(Description desc) { - desc.appendText("has ").appendValue(count).appendText(" features"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - public boolean matches(Object o) { - return (o instanceof EClass) && (((EClass)o).getEStructuralFeatures().size() == count); - } - }; - } - - Matcher hasFeature(final String name) { - return new BaseMatcher() { - - public void describeTo(Description desc) { - desc.appendText("has a \"").appendValue(name).appendText("\" feature"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - public boolean matches(Object o) { - return (o instanceof EClass) && (((EClass)o).getEStructuralFeature(name) != null); - } - }; - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTest.java deleted file mode 100644 index 72db79ae738..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTest.java +++ /dev/null @@ -1,122 +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 482949 - * - */ -package org.eclipse.papyrus.infra.core.resource; - -import static org.junit.Assert.fail; - -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.papyrus.junit.utils.rules.HouseKeeper; - - -/** - * Test suite for the {@link ResourceAdapter} class. - */ -public class ResourceAdapterTest extends AbstractResourceAdapterTest { - - public ResourceAdapterTest() { - super(); - } - - // - // Test framework - // - - @Override - protected ResourceSet createTarget(HouseKeeper keeper) { - return keeper.createResourceSet(); - } - - @Override - protected ResourceSet getResourceSet(ResourceSet target) { - return target; - } - - @Override - protected void execute(Runnable command) { - command.run(); - } - - @Override - protected void safeExecute(RunnableWithException command) { - try { - command.run(); - } catch (Exception e) { - e.printStackTrace(); - fail("Command execution failed: " + e.getMessage()); - } - } - - @Override - protected AbstractResourceAdapterTest.Fixture doCreateFixture() { - return new MyFixture(); - } - - class MyFixture extends Fixture { - - @Override - protected void doInstall(ResourceAdapter adapter, ResourceSet target) { - if (!target.eAdapters().contains(adapter)) { - target.eAdapters().add(adapter); - } - } - - @Override - protected void doUninstall(ResourceAdapter adapter, ResourceSet target) { - target.eAdapters().remove(adapter); - } - - @Override - protected ResourceAdapter createAdapter() { - return new ResourceAdapter() { - @Override - protected void handleResourceAdded(Resource resource) { - MyFixture.this.handleResourceAdded(resource); - } - - @Override - protected void handleResourceRemoved(Resource resource) { - MyFixture.this.handleResourceRemoved(resource); - } - - @Override - protected void handleResourceLoaded(Resource resource) { - MyFixture.this.handleResourceLoaded(resource); - } - - @Override - protected void handleResourceUnloaded(Resource resource) { - MyFixture.this.handleResourceUnloaded(resource); - } - - @Override - protected void handleResourceURI(Resource resource, URI oldURI, URI newURI) { - MyFixture.this.handleResourceURI(resource, oldURI, newURI); - } - - @Override - protected void handleRootAdded(Resource resource, EObject root) { - MyFixture.this.handleRootAdded(resource, root); - } - - @Override - protected void handleRootRemoved(Resource resource, EObject root) { - MyFixture.this.handleRootRemoved(resource, root); - } - }; - } - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTransactionalTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTransactionalTest.java deleted file mode 100644 index 97e6cd3a857..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTransactionalTest.java +++ /dev/null @@ -1,138 +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.infra.core.resource; - -import org.eclipse.emf.common.util.URI; -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.transaction.RecordingCommand; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; - - -/** - * Test suite for the {@link ResourceAdapter.Transactional} class. - */ -public class ResourceAdapterTransactionalTest extends AbstractResourceAdapterTest { - - public ResourceAdapterTransactionalTest() { - super(); - } - - // - // Test framework - // - - @Override - protected boolean isTransactional() { - return true; - } - - @Override - protected TransactionalEditingDomain createTarget(HouseKeeper keeper) { - return keeper.createSimpleEditingDomain(); - } - - @Override - protected ResourceSet getResourceSet(TransactionalEditingDomain target) { - return target.getResourceSet(); - } - - @Override - protected void execute(Runnable command) { - TransactionalEditingDomain domain = getTarget(); - domain.getCommandStack().execute(new RecordingCommand(domain, "Test") { - - @Override - protected void doExecute() { - command.run(); - } - }); - } - - @Override - protected void safeExecute(RunnableWithException command) { - TransactionalEditingDomain domain = getTarget(); - domain.getCommandStack().execute(new RecordingCommand(domain, "Test") { - - @Override - protected void doExecute() { - try { - command.run(); - } catch (Exception e) { - throw new WrappedException(e); - } - } - }); - } - - @Override - protected Fixture doCreateFixture() { - return new MyFixture(); - } - - class MyFixture extends Fixture { - - @Override - protected void doInstall(ResourceAdapter.Transactional adapter, TransactionalEditingDomain target) { - adapter.install(target); - } - - @Override - protected void doUninstall(ResourceAdapter.Transactional adapter, TransactionalEditingDomain target) { - adapter.uninstall(target); - } - - @Override - protected ResourceAdapter.Transactional createAdapter() { - return new ResourceAdapter.Transactional() { - @Override - protected void handleResourceAdded(Resource resource) { - MyFixture.this.handleResourceAdded(resource); - } - - @Override - protected void handleResourceRemoved(Resource resource) { - MyFixture.this.handleResourceRemoved(resource); - } - - @Override - protected void handleResourceLoaded(Resource resource) { - MyFixture.this.handleResourceLoaded(resource); - } - - @Override - protected void handleResourceUnloaded(Resource resource) { - MyFixture.this.handleResourceUnloaded(resource); - } - - @Override - protected void handleResourceURI(Resource resource, URI oldURI, URI newURI) { - MyFixture.this.handleResourceURI(resource, oldURI, newURI); - } - - @Override - protected void handleRootAdded(Resource resource, EObject root) { - MyFixture.this.handleRootAdded(resource, root); - } - - @Override - protected void handleRootRemoved(Resource resource, EObject root) { - MyFixture.this.handleRootRemoved(resource, root); - } - }; - } - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/TestTrace.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/TestTrace.java deleted file mode 100644 index 5703afaa9d1..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/TestTrace.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.infra.core.resource; - -import java.util.ArrayList; -import java.util.List; - - -/** - * A class used to record traces for tests - * - * @author cedric dumoulin - * - */ -public class TestTrace { - - public Listtraces = new ArrayList(); - - /** - * Record a new trace. - * @param trace - */ - public void addTrace(String trace) { - addTrace(null, trace, null); - } - - /** - * Record a new trace. - * @param trace - */ - public void addTrace(String name, String trace) { - addTrace(name, trace, null); - } - - /** - * Record a new trace. - * @param trace - */ - public void addTrace(String name, String trace, Object value) { - traces.add(new TraceRecord( name, trace, value)); - } - - /** - * Return true if the trace contains the specified events. - * @return - */ - public boolean contains( String name, String trace) { - - return indexOfNameTrace(name, trace) >= 0; - } - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public int indexOf(String name, String trace, Object value) { - - for (int i = 0; i < traces.size(); i++) { - TraceRecord record = traces.get(i); - - if( name.equals(record.name) && trace.equals(record.trace) ) - return i; - } - - return -1; - } - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public int indexOfNameTrace(String name, String trace) { - - for (int i = 0; i < traces.size(); i++) { - TraceRecord record = traces.get(i); - - if( name.equals(record.name) && trace.equals(record.trace) ) - return i; - } - - return -1; - } - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public int indexOfTrace(String trace) { - - for (int i = 0; i < traces.size(); i++) { - TraceRecord record = traces.get(i); - - if( trace.equals(record.trace) ) - return i; - } - - return -1; - } - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public int indexOfName(String name) { - - for (int i = 0; i < traces.size(); i++) { - TraceRecord record = traces.get(i); - - if( name.equals(record.name) ) - return i; - } - - return -1; - } - - /** - * Reset the trace. - */ - public void reset() { - traces.clear(); - } - - - /** - * @return the traces - */ - public List getTraces() { - return traces; - } - - /** - * A Record of the trace. - */ - public class TraceRecord { - public String name; - public String trace; - public Object value; - /** - * Constructor. - * - * @param name - * @param trace - * @param value - */ - public TraceRecord(String name, String trace, Object value) { - this.name = name; - this.trace = trace; - this.value = value; - } - - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ComposedServiceTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ComposedServiceTest.java deleted file mode 100644 index 7492d60c2e4..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ComposedServiceTest.java +++ /dev/null @@ -1,156 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010, 2016 LIFL, 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: - * LIFL - Initial API and implementation - * Christian W. Damus - bug 488791 - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.services; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.util.List; - -import org.eclipse.papyrus.infra.core.services.ServicesRegistryTest.TestServiceDescriptor; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - - -public class ComposedServiceTest extends AbstractPapyrusTest { - - private FakeComposedService masterService; - - - @Before - public void setUp() throws Exception { - masterService = new FakeComposedService(); - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testAddServicePart() { - FakeComposedServicePartA partA = new FakeComposedServicePartA(); - FakeComposedServicePartB partB = new FakeComposedServicePartB(); - - masterService.addServicePart(partA); - masterService.addServicePart(partB); - - List addedParts = masterService.getRegisteredServices(); - - assertTrue("service contains partA", addedParts.contains(partA)); - assertTrue("service contains partB", addedParts.contains(partB)); - } - - @Test - public void testRemoveServicePart() { - FakeComposedServicePartA partA = new FakeComposedServicePartA(); - FakeComposedServicePartB partB = new FakeComposedServicePartB(); - - masterService.addServicePart(partA); - masterService.addServicePart(partB); - - List addedParts = masterService.getRegisteredServices(); - - assertTrue("service contains partA", addedParts.contains(partA)); - assertTrue("service contains partB", addedParts.contains(partB)); - - masterService.removeServicePart(partA); - assertFalse("service contains partA", addedParts.contains(partA)); - assertTrue("service contains partB", addedParts.contains(partB)); - - } - - /** - * Test that the parts registered to the ServiceRegistry are automaticly - * registered to there associated main service when registry is started. - * - * @throws ServiceException - */ - @Test - public void testPartAutomaticRegistration() throws ServiceException { - - ServicesRegistry serviceRegistry = new ServicesRegistry(); - - // Register services - serviceRegistry.add(new ComposedServiceDescriptor()); - serviceRegistry.add(new ServicePartADescriptor()); - serviceRegistry.add(new ServicePartBDescriptor()); - - // start registry - serviceRegistry.startRegistry(); - - // Check if connected - FakeComposedService masterService = serviceRegistry.getService(FakeComposedService.class); - FakeComposedServicePartA partA = serviceRegistry.getService(FakeComposedServicePartA.class); - FakeComposedServicePartB partB = serviceRegistry.getService(FakeComposedServicePartB.class); - - List addedParts = masterService.getRegisteredServices(); - - assertNotNull("master service found", masterService); - assertTrue("service contains partA", addedParts.contains(partA)); - assertTrue("service contains partB", addedParts.contains(partB)); - - - } - - - /* ***************************** */ - - /** - * A descriptor - * - * @author dumoulin - * - */ - public class ServicePartADescriptor extends TestServiceDescriptor { - - - public ServicePartADescriptor() { - super(FakeComposedServicePartA.class, FakeComposedServicePartA.class.getName(), ServiceStartKind.STARTUP, 1); - } - } - - - /** - * A descriptor - * - * @author dumoulin - * - */ - public class ServicePartBDescriptor extends TestServiceDescriptor { - - - public ServicePartBDescriptor() { - super(FakeComposedServicePartB.class, FakeComposedServicePartB.class.getName(), ServiceStartKind.STARTUP, 1); - } - } - - /** - * A descriptor - * - * @author dumoulin - * - */ - public class ComposedServiceDescriptor extends TestServiceDescriptor { - - - public ComposedServiceDescriptor() { - super(FakeComposedService.class, FakeComposedService.class.getName(), ServiceStartKind.STARTUP, 1); - } - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedService.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedService.java deleted file mode 100644 index fe2d4f0d293..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedService.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.infra.core.services; - - - - -/** - * A fake composed service for testing purpose. - * - * @author cedric dumoulin - * - */ -public class FakeComposedService extends ComposedService { - - /** - * Call the same method on all associated service parts. - */ - public void walkService() { - - for( FakeComposedServicePart servicePart : serviceParts ) - { - servicePart.walkService(); - } - } - - @Override - public void init(ServicesRegistry servicesRegistry) throws ServiceException { - // TODO Auto-generated method stub - - } - - @Override - public void startService() throws ServiceException { - // TODO Auto-generated method stub - - } - - @Override - public void disposeService() throws ServiceException { - // TODO Auto-generated method stub - - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePart.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePart.java deleted file mode 100644 index 72abc31d17d..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePart.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.infra.core.services; - - - -/** - * A fake composed service part for testing purpose. - * @author cedric dumoulin - * - */ -public class FakeComposedServicePart extends ComposedServicePart { - - - public FakeComposedServicePart() { - super(FakeComposedService.class); - } - - /** - * A common method. - */ - public void walkService() { - // TODO Auto-generated method stub - - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartA.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartA.java deleted file mode 100644 index 9a7f28f1589..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartA.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.infra.core.services; - - -/** - * @author dumoulin - * - */ -public class FakeComposedServicePartA extends FakeComposedServicePart { - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartB.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartB.java deleted file mode 100644 index 18f7e61102e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartB.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.infra.core.services; - - -/** - * @author dumoulin - * - */ -public class FakeComposedServicePartB extends FakeComposedServicePart { - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeService.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeService.java deleted file mode 100644 index 3f9b9e08866..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeService.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.eclipse.papyrus.infra.core.services; - - - -/** - * Fake service for testing purpose. - * - * @author cedric dumoulin - * - */ -public class FakeService implements IService { - - - static public TestTrace trace = new TestTrace(); - - static int count = 0; - - public String name = "name" + count++; - - - /** - * - * Constructor. - * - */ - public FakeService() { - trace.addTrace(name, "create"); - } - - /** - * Constructor. - * - * @param name - */ - public FakeService(String name) { - this.name = name; - trace.addTrace(name, "create"); - } - - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @return the trace - */ - static public TestTrace getTrace() { - return trace; - } - - - /** - * @param trace the trace to set - */ - public void setTrace(TestTrace trace) { - this.trace = trace; - } - - public void init(ServicesRegistry servicesRegistry) { - trace.addTrace(name, "init", servicesRegistry); - } - - public void startService() { - trace.addTrace(name, "start"); - } - - public void disposeService() { - trace.addTrace(name, "dispose"); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeServiceFactory.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeServiceFactory.java deleted file mode 100644 index 8332ebee584..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeServiceFactory.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.eclipse.papyrus.infra.core.services; - - - -/** - * Fake service factory for testing purpose. - * - * @author cedric dumoulin - * - */ -public class FakeServiceFactory extends FakeService implements IServiceFactory { - - - /** - * - * Constructor. - * - */ - public FakeServiceFactory() { - - super( "factoryName" + count++ ); - } - - /** - * Constructor. - * - * @param name - */ - public FakeServiceFactory(String name) { - super(name); - } - - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * Create the service - * @see org.eclipse.papyrus.infra.core.services.IServiceFactory#createServiceInstance() - * - * @return - */ - public Object createServiceInstance() { - trace.addTrace(getName(), "createInstance"); - return new FakeCreatedService(); - } - - /** - * Pseudo service created by the factory. - * @author dumoulin - * - */ - public class FakeCreatedService { - - /** - * @return the name - */ - public String getName() { - return name; - } - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeWithRequiredServiceFactory.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeWithRequiredServiceFactory.java deleted file mode 100644 index 0573a85f91e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeWithRequiredServiceFactory.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.papyrus.infra.core.services; - - - -/** - * Fake service factory for testing purpose. - * This service require the - * - * @author cedric dumoulin - * - */ -public class FakeWithRequiredServiceFactory extends FakeServiceFactory implements IServiceFactory { - - - /** - * - * Constructor. - * - */ - public FakeWithRequiredServiceFactory() { - - super( "factoryName" + count++ ); - } - - /** - * Constructor. - * - * @param name - */ - public FakeWithRequiredServiceFactory(String name) { - super(name); - } - - - /** - * - * @see org.eclipse.papyrus.infra.core.services.FakeService#init(org.eclipse.papyrus.infra.core.services.ServicesRegistry) - * - * @param servicesRegistry - */ - @Override - public void init(ServicesRegistry servicesRegistry) { - - trace.addTrace(name, "init"); - Object foundService = null; - try { - foundService = servicesRegistry.getService("C"); - } catch (ServiceException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - trace.addTrace(name, "initEnd", foundService); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA.java deleted file mode 100644 index b117f270449..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.eclipse.papyrus.infra.core.services; - -import java.util.ArrayList; -import java.util.List; - -public class ServiceA implements IService { - - public enum TraceKind { - init, start, dispose - }; - - static List trace = new ArrayList(); - - static List nametrace = new ArrayList(); - - - - static public TraceKind getEvent(int index) { - return trace.get(index); - } - - static public String getTraceName(int index) { - return nametrace.get(index); - } - - static public void resetTrace() { - trace.clear(); - nametrace.clear(); - } - - public void init(ServicesRegistry servicesRegistry) { - trace.add(TraceKind.init); - nametrace.add(this.getClass().getSimpleName()); - - } - - public void startService() { - trace.add(TraceKind.start); - nametrace.add(this.getClass().getSimpleName()); - - } - - public void disposeService() { - trace.add(TraceKind.dispose); - nametrace.add(this.getClass().getSimpleName()); - - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA10.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA10.java deleted file mode 100644 index b8520e27ea7..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA10.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.eclipse.papyrus.infra.core.services; - - -public class ServiceA10 extends ServiceA { - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceB.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceB.java deleted file mode 100644 index 7a675ef39e2..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceB.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.eclipse.papyrus.infra.core.services; - - -public class ServiceB extends ServiceA { - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceC.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceC.java deleted file mode 100644 index 926ab731aff..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceC.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.eclipse.papyrus.infra.core.services; - - -public class ServiceC extends ServiceA { - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicePojoA.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicePojoA.java deleted file mode 100644 index 111d15ca791..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicePojoA.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.eclipse.papyrus.infra.core.services; - - -public class ServicePojoA extends ServiceA { - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicesRegistryTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicesRegistryTest.java deleted file mode 100644 index 0b8e1ce035e..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicesRegistryTest.java +++ /dev/null @@ -1,846 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010, 2016 LIFL, 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: - * LIFL - Initial API and implementation - * Christian W. Damus - bugs 488791, 488558 - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.services; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.util.Arrays; -import java.util.List; - -import org.eclipse.papyrus.infra.core.services.FakeServiceFactory.FakeCreatedService; -import org.eclipse.papyrus.infra.core.services.ServiceA.TraceKind; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.junit.Before; -import org.junit.Test; - - -/** - * @author dumoulin - * - */ -public class ServicesRegistryTest extends AbstractPapyrusTest { - - /** The registry to test */ - ServicesRegistry servicesRegistry; - - ServiceDescriptor serviceADesc = new LazyServiceADescriptor(); - - ServiceDescriptor serviceA10Desc = new LazyServiceA10Descriptor(); - - ServiceDescriptor serviceBDesc = new LazyServiceBDescriptor(); - - ServiceDescriptor serviceCDesc = new ServiceCDescriptor(); - - ServiceDescriptor servicePojoADesc = new LazyServicePojoADescriptor(); - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - servicesRegistry = new ServicesRegistry(); - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.services.ServicesRegistry#add(org.eclipse.papyrus.infra.core.services.ServiceDescriptor)} - * . - * - * @throws ServiceMultiException - */ - @Test - public void testAdd() throws ServiceMultiException { - - servicesRegistry.add(serviceADesc); - servicesRegistry.add(serviceBDesc); - servicesRegistry.add(serviceCDesc); - servicesRegistry.add(servicePojoADesc); - - // Test entries creation - // try { - // assertFalse("serviceA stopped", servicesRegistry.isStarted(serviceADesc.getKey())); - // assertFalse("serviceB stopped", servicesRegistry.isStarted(serviceBDesc.getKey())); - // assertFalse("serviceC stopped", servicesRegistry.isStarted(serviceCDesc.getKey())); - // assertFalse("servicePojoA stopped", servicesRegistry.isStarted(servicePojoADesc.getKey())); - // } catch (ServiceNotFoundException e) { - // fail("Service should exist." + e.getMessage()); - // } - - // Test startup - servicesRegistry.startRegistry(); - - // Test always started - try { - assertFalse("serviceA stopped", servicesRegistry.isStarted(serviceADesc.getKey())); - assertFalse("serviceB stopped", servicesRegistry.isStarted(serviceBDesc.getKey())); - assertEquals("serviceC state", ServiceState.started, servicesRegistry.serviceState(serviceCDesc.getKey())); - assertTrue("serviceC started", servicesRegistry.isStarted(serviceCDesc.getKey())); - assertFalse("servicePojoA stopped", servicesRegistry.isStarted(servicePojoADesc.getKey())); - } catch (ServiceNotFoundException e) { - fail("Service should exist."); - } - - - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.services.ServicesRegistry#getService(java.lang.Object)}. - * - * @throws ServiceException - */ - @Test - public void testGetService() throws ServiceException { - servicesRegistry.add(serviceADesc); - servicesRegistry.add(serviceBDesc); - servicesRegistry.add(serviceCDesc); - servicesRegistry.add(servicePojoADesc); - - - servicesRegistry.startRegistry(); - - // Test lazy service - Object serviceA = servicesRegistry.getService(serviceADesc.getKey()); - assertNotNull("service created", serviceA); - assertEquals("right class", ServiceA.class, serviceA.getClass()); - - Object serviceA2 = servicesRegistry.getService(serviceADesc.getKey()); - assertEquals("Second retrieve get the same service", serviceA, serviceA2); - - // test startup service - Object serviceC = servicesRegistry.getService(serviceCDesc.getKey()); - assertNotNull("service created", serviceC); - assertEquals("right class", ServiceC.class, serviceC.getClass()); - - Object serviceC2 = servicesRegistry.getService(serviceCDesc.getKey()); - assertEquals("Second retrieve get the same service", serviceC, serviceC2); - - // test pojo service - Object servicePojo = servicesRegistry.getService(servicePojoADesc.getKey()); - assertNotNull("service created", servicePojo); - assertEquals("right class", ServicePojoA.class, servicePojo.getClass()); - - Object servicePojo2 = servicesRegistry.getService(servicePojoADesc.getKey()); - assertEquals("Second retrieve get the same service", servicePojo, servicePojo2); - - - } - - /** - * Test method for {@link org.eclipse.papyrus.infra.core.services.ServicesRegistry#getService(java.lang.Object)}. - * - * @throws ServiceException - */ - @Test - public void testGetServiceByClass() throws ServiceException { - servicesRegistry.add(serviceADesc); - servicesRegistry.add(serviceBDesc); - servicesRegistry.add(serviceCDesc); - servicesRegistry.add(servicePojoADesc); - - - servicesRegistry.startRegistry(); - - // Test lazy service - ServiceA serviceA = servicesRegistry.getService(ServiceA.class); - assertNotNull("service created", serviceA); - assertEquals("right class", ServiceA.class, serviceA.getClass()); - - ServiceA serviceA2 = servicesRegistry.getService(ServiceA.class); - assertEquals("Second retrieve get the same service", serviceA, serviceA2); - - // test startup service - ServiceC serviceC = servicesRegistry.getService(ServiceC.class); - assertNotNull("service created", serviceC); - assertEquals("right class", ServiceC.class, serviceC.getClass()); - - // test pojo service - ServicePojoA servicePojo = servicesRegistry.getService(ServicePojoA.class); - assertNotNull("service created", servicePojo); - assertEquals("right class", ServicePojoA.class, servicePojo.getClass()); - - Object servicePojo2 = servicesRegistry.getService(ServicePojoA.class); - assertEquals("Second retrieve get the same service", servicePojo, servicePojo2); - - - } - - /** - * Try to register 2 services under the same name, but with different priorities. - * - * @throws ServiceException - */ - @Test - public void testPriority() throws ServiceException { - servicesRegistry.add(serviceADesc); - servicesRegistry.add(serviceA10Desc); - servicesRegistry.add(serviceBDesc); - - // Test creation - // try { - // assertFalse("serviceA stopped", servicesRegistry.isStarted(serviceADesc.getKey())); - // assertFalse("serviceB stopped", servicesRegistry.isStarted(serviceBDesc.getKey())); - // } catch (ServiceNotFoundException e) { - // fail("Service should exist."); - // } - - servicesRegistry.startRegistry(); - - Object serviceA = servicesRegistry.getService(serviceADesc.getKey()); - - assertNotNull("Service created", serviceA); - assertEquals("right class", ServiceA10.class, serviceA.getClass()); - - - } - - /** - * Test add for a direct instance of service. - * - * @throws ServiceException - */ - @Test - public void testAddDirectInstance() throws ServiceException { - IService instanciatedService = new ServiceA(); - String key = instanciatedService.getClass().getName(); - - servicesRegistry.add(key, 1, instanciatedService); - - servicesRegistry.add(serviceCDesc); - servicesRegistry.add(serviceBDesc); - - servicesRegistry.startRegistry(); - - Object serviceA = servicesRegistry.getService(key); - - assertNotNull("Service created", serviceA); - assertEquals("right object", instanciatedService, serviceA); - assertEquals("right class", ServiceA.class, serviceA.getClass()); - - - } - - /** - * Test life cycle for directly registered services - * - * @throws ServiceException - */ - @Test - public void testCallsOrder() throws ServiceException { - // Register services as STARTUP ! - servicesRegistry.add(ServiceA.class, 1, new ServiceA()); - // Lazy - generate no trace - servicesRegistry.add(ServiceB.class, 1, new ServiceB(), ServiceStartKind.LAZY); - servicesRegistry.add(ServiceC.class, 1, new ServiceC()); - servicesRegistry.add(ServicePojoA.class, 1, new ServicePojoA()); - - - ServiceA.resetTrace(); - servicesRegistry.startRegistry(); - - // Check orders - // - int i = 0; - assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); - assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); - assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); - // assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); - - assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); - assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); - assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); - // assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); - - // Now, start lazy service - ServiceB service = servicesRegistry.getService(ServiceB.class); - assertNotNull("service found", service); - assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); - assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); - - - // Check dispose - servicesRegistry.disposeRegistry(); - assertEquals("service", TraceKind.dispose, ServiceA.getEvent(i++)); - assertEquals("service", TraceKind.dispose, ServiceA.getEvent(i++)); - assertEquals("service", TraceKind.dispose, ServiceA.getEvent(i++)); - // assertEquals("service", TraceKind.dispose, ServiceA.getEvent(i++)); - - // - } - - /** - * Test life cycle for services registered wih descriptors - * - * @throws ServiceException - */ - @Test - public void testCallsOrderForDescriptors() throws ServiceException { - // Register services as STARTUP ! - // Lazy - generate no trace - servicesRegistry.add(new LazyServiceBDescriptor()); - servicesRegistry.add(new ServiceCDescriptor()); - - - ServiceA.resetTrace(); - servicesRegistry.startRegistry(); - - // Check orders - // - int i = 0; - assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); - // assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); - - assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); - // assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); - - // Now, start lazy service - ServiceB service = (ServiceB) servicesRegistry.getService(ServiceB.class.getName()); - assertNotNull("service found", service); - assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); - assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); - - - // Check dispose - servicesRegistry.disposeRegistry(); - assertEquals("service", TraceKind.dispose, ServiceA.getEvent(i++)); - assertEquals("service", TraceKind.dispose, ServiceA.getEvent(i++)); - // assertEquals("service", TraceKind.dispose, ServiceA.getEvent(i++)); - - // - } - - /** - * Test the start order for services of type Start and Service - * - * @throws ServiceException - */ - @Test - public void testStartDependantOrder() throws ServiceException { - - String A = "A"; - String B = "B"; - String C = "C"; - String D = "D"; - String E = "E"; - // String F = "F"; - - // Create services E --> D --> C --> B --> A - FakeService.getTrace().reset(); - - servicesRegistry.add(new ServiceDesc(E, ServiceStartKind.STARTUP, Arrays.asList(D))); - servicesRegistry.add(new ServiceDesc(D, ServiceStartKind.STARTUP, Arrays.asList(C))); - servicesRegistry.add(new ServiceDesc(C, ServiceStartKind.STARTUP, Arrays.asList(B))); - servicesRegistry.add(new ServiceDesc(B, ServiceStartKind.STARTUP, Arrays.asList(A))); - servicesRegistry.add(new ServiceDesc(A, ServiceStartKind.STARTUP)); - // servicesRegistry.add( new ServiceDesc( F, ServiceStartKind.STARTUP, Arrays.asList(E) )); - - // Start services - servicesRegistry.startRegistry(); - - // check services - assertTrue("service started", servicesRegistry.isStarted(A)); - assertTrue("service started", servicesRegistry.isStarted(B)); - assertNotSame("services are different", servicesRegistry.getService(A), servicesRegistry.getService(B)); - - // Get names of created services - String nameA = ((FakeService) servicesRegistry.getService(A)).getName(); - String nameB = ((FakeService) servicesRegistry.getService(B)).getName(); - String nameC = ((FakeService) servicesRegistry.getService(C)).getName(); - String nameD = ((FakeService) servicesRegistry.getService(D)).getName(); - String nameE = ((FakeService) servicesRegistry.getService(E)).getName(); - // String nameF = ((FakeService)servicesRegistry.getService(F)).getName(); - - - // check order (E and F order are not guaranteed) - // order should be A, B, C, D, E - TestTrace trace = FakeService.getTrace(); - int i = 0; - // assertEquals("order", nameF + ",create", trace.getNameTrace(i++)); - assertEquals("order", nameA + ",create", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",create", trace.getNameTrace(i++)); - assertEquals("order", nameC + ",create", trace.getNameTrace(i++)); - assertEquals("order", nameD + ",create", trace.getNameTrace(i++)); - assertEquals("order", nameE + ",create", trace.getNameTrace(i++)); - - // assertEquals("order", nameF + ",init", trace.getNameTrace(i++)); - assertEquals("order", nameA + ",init", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",init", trace.getNameTrace(i++)); - assertEquals("order", nameC + ",init", trace.getNameTrace(i++)); - assertEquals("order", nameD + ",init", trace.getNameTrace(i++)); - assertEquals("order", nameE + ",init", trace.getNameTrace(i++)); - - // assertEquals("order", nameF + ",start", trace.getNameTrace(i++)); - assertEquals("order", nameA + ",start", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",start", trace.getNameTrace(i++)); - assertEquals("order", nameC + ",start", trace.getNameTrace(i++)); - assertEquals("order", nameD + ",start", trace.getNameTrace(i++)); - assertEquals("order", nameE + ",start", trace.getNameTrace(i++)); - - } - - /** - * Start regular services, then add a new service and try to start it. - * This should work. - * - * @throws ServiceException - */ - @Test - public void testStartRegistryAndThenAddNewServiceAndStartIt() throws ServiceException { - - // Register some services - String A = "A"; - String B = "B"; - String C = "C"; - servicesRegistry.add(new ServiceFactoryDesc(C, ServiceStartKind.STARTUP)); - servicesRegistry.add(new ServiceFactoryDesc(B, ServiceStartKind.STARTUP, Arrays.asList(C))); - servicesRegistry.add(new ServiceFactoryDesc(A, ServiceStartKind.STARTUP, Arrays.asList(B))); - - // Start them - servicesRegistry.startRegistry(); - - // Register another services as pojo - IService instanciatedService = new ServiceA(); - String key = instanciatedService.getClass().getName(); - servicesRegistry.add(key, 1, instanciatedService); - - // Try to start it - servicesRegistry.startServices(key); - - // check services - assertTrue("service started", servicesRegistry.isStarted(A)); - assertTrue("service started", servicesRegistry.isStarted(B)); - assertTrue("service started", servicesRegistry.isStarted(C)); - - assertTrue("service started", servicesRegistry.isStarted(key)); - - assertEquals("get registered service", instanciatedService, servicesRegistry.getService(key)); - - } - - /** - * Test Service Factory creation - * - * @throws ServiceException - */ - @Test - public void testServiceFactoryCreation() throws ServiceException { - - String A = "A"; - String B = "B"; - String C = "C"; - - // Create services - FakeService.getTrace().reset(); - - servicesRegistry.add(new ServiceFactoryDesc(C, ServiceStartKind.STARTUP)); - servicesRegistry.add(new ServiceFactoryDesc(B, ServiceStartKind.STARTUP, Arrays.asList(C))); - servicesRegistry.add(new ServiceFactoryDesc(A, ServiceStartKind.STARTUP, Arrays.asList(B))); - - // Start services - servicesRegistry.startRegistry(); - - // check services - assertSame("service type", FakeCreatedService.class, servicesRegistry.getService(A).getClass()); - assertSame("service type", FakeCreatedService.class, servicesRegistry.getService(B).getClass()); - - // Get names of created services - String nameA = ((FakeCreatedService) servicesRegistry.getService(A)).getName(); - String nameB = ((FakeCreatedService) servicesRegistry.getService(B)).getName(); - String nameC = ((FakeCreatedService) servicesRegistry.getService(C)).getName(); - - - // check order - // Order should be: C, B, A - TestTrace trace = FakeService.getTrace(); - int i = 0; - assertEquals("order", nameC + ",create", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",create", trace.getNameTrace(i++)); - assertEquals("order", nameA + ",create", trace.getNameTrace(i++)); - - assertEquals("order", nameC + ",init", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",init", trace.getNameTrace(i++)); - assertEquals("order", nameA + ",init", trace.getNameTrace(i++)); - - assertEquals("order", nameC + ",start", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",start", trace.getNameTrace(i++)); - assertEquals("order", nameA + ",start", trace.getNameTrace(i++)); - - // next order is the order of getService() - assertEquals("order", nameA + ",createInstance", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",createInstance", trace.getNameTrace(i++)); - assertEquals("order", nameC + ",createInstance", trace.getNameTrace(i++)); - } - - /** - * Test Creation of Service Factory used with class as key. - * - * @throws ServiceException - */ - @Test - public void testServiceFactoryWithClassKey() throws ServiceException { - - // - Class A = ServiceA.class; - Class B = ServiceB.class; - Class C = ServiceC.class; - - // Specify service types as String - String serviceClassname1 = FakeServiceFactory.class.getName(); - ; - String serviceClassname2 = FakeServiceFactory.class.getName(); - String serviceClassname3 = FakeServiceFactory.class.getName(); - - // Create services - FakeService.getTrace().reset(); - - servicesRegistry.add(new ServiceFactoryDesc(C, serviceClassname3, ServiceStartKind.STARTUP)); - servicesRegistry.add(new ServiceFactoryDesc(B, serviceClassname2, ServiceStartKind.STARTUP, Arrays.asList(C.getName()))); - servicesRegistry.add(new ServiceFactoryDesc(A, serviceClassname1, ServiceStartKind.STARTUP, Arrays.asList(B.getName()))); - - // Start services - servicesRegistry.startRegistry(); - - // check services - assertSame("service type", FakeCreatedService.class, servicesRegistry.getService(A).getClass()); - assertSame("service type", FakeCreatedService.class, servicesRegistry.getService(B).getClass()); - - // Get names of created services - String nameA = ((FakeCreatedService) servicesRegistry.getService(A)).getName(); - String nameB = ((FakeCreatedService) servicesRegistry.getService(B)).getName(); - String nameC = ((FakeCreatedService) servicesRegistry.getService(C)).getName(); - - - // check order (E and F order are not guaranteed) - // Order should be - TestTrace trace = FakeService.getTrace(); - int i = 0; - assertEquals("order", nameC + ",create", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",create", trace.getNameTrace(i++)); - assertEquals("order", nameA + ",create", trace.getNameTrace(i++)); - - assertEquals("order", nameC + ",init", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",init", trace.getNameTrace(i++)); - assertEquals("order", nameA + ",init", trace.getNameTrace(i++)); - - assertEquals("order", nameC + ",start", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",start", trace.getNameTrace(i++)); - assertEquals("order", nameA + ",start", trace.getNameTrace(i++)); - - // next order is the order of getService() - assertEquals("order", nameA + ",createInstance", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",createInstance", trace.getNameTrace(i++)); - assertEquals("order", nameC + ",createInstance", trace.getNameTrace(i++)); - } - - /** - * Test Service Factory creation order. - * One of the factory try to get the required service from its init() method. - * - * @throws ServiceException - */ - @Test - public void testServiceFactoryWithRequiredInInit() throws ServiceException { - - String A = "A"; - String B = "B"; - String C = "C"; - - // Create services C --> A --> B - FakeService.getTrace().reset(); - - // FakeWithRequiredServiceFactory try to retrieve service "C" - servicesRegistry.add(new ServiceFactoryDesc(B, FakeWithRequiredServiceFactory.class.getName(), ServiceStartKind.STARTUP, 1, Arrays.asList(C))); - servicesRegistry.add(new ServiceFactoryDesc(A, FakeWithRequiredServiceFactory.class.getName(), ServiceStartKind.STARTUP, 1, Arrays.asList(B, C))); - servicesRegistry.add(new ServiceFactoryDesc(C, FakeServiceFactory.class.getName(), ServiceStartKind.STARTUP, 1)); - - // Start services - servicesRegistry.startRegistry(); - - // check services - assertSame("service type", FakeCreatedService.class, servicesRegistry.getService(A).getClass()); - assertSame("service type", FakeCreatedService.class, servicesRegistry.getService(B).getClass()); - - // Get names of created services - String nameA = ((FakeCreatedService) servicesRegistry.getService(A)).getName(); - String nameB = ((FakeCreatedService) servicesRegistry.getService(B)).getName(); - String nameC = ((FakeCreatedService) servicesRegistry.getService(C)).getName(); - - - // check order - // Order should be: C, B, A - TestTrace trace = FakeService.getTrace(); - int i = 0; - assertEquals("order", nameC + ",create", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",create", trace.getNameTrace(i++)); - assertEquals("order", nameA + ",create", trace.getNameTrace(i++)); - - assertEquals("order", nameC + ",init", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",init", trace.getNameTrace(i++)); - - assertEquals("order", nameC + ",createInstance", trace.getNameTrace(i++)); - assertEquals("value", servicesRegistry.getService(C), trace.getValue(i)); - assertEquals("order", nameB + ",initEnd", trace.getNameTrace(i++)); - - assertEquals("order", nameA + ",init", trace.getNameTrace(i++)); - assertEquals("order", nameA + ",initEnd", trace.getNameTrace(i++)); - - assertEquals("order", nameC + ",start", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",start", trace.getNameTrace(i++)); - assertEquals("order", nameA + ",start", trace.getNameTrace(i++)); - - // next order is the order of getService() - assertEquals("order", nameA + ",createInstance", trace.getNameTrace(i++)); - // assertEquals("order", nameB + ",createInstance", trace.getNameTrace(i++)); - // assertEquals("order", nameC + ",createInstance", trace.getNameTrace(i++)); - } - - /** - * Test {@link ServicesRegistry#startServicesByClassKeys(List)}. - * Check that services are started. - * - * @throws ServiceException - */ - @Test - public void testStartService() throws ServiceException { - - String A = "A"; - String B = "B"; - String C = "C"; - String D = "D"; - String E = "E"; - - // Create services E --> D --> C --> B --> A - FakeService.getTrace().reset(); - - servicesRegistry.add(new ServiceDesc(E, ServiceStartKind.STARTUP, Arrays.asList(D))); - servicesRegistry.add(new ServiceDesc(D, ServiceStartKind.STARTUP, Arrays.asList(C))); - servicesRegistry.add(new ServiceDesc(C, ServiceStartKind.STARTUP, Arrays.asList(A, B))); - servicesRegistry.add(new ServiceDesc(B, ServiceStartKind.STARTUP, Arrays.asList(A))); - servicesRegistry.add(new ServiceDesc(A, ServiceStartKind.STARTUP)); - - // Start services - servicesRegistry.startServices(Arrays.asList(C)); - - // check services - assertTrue("service started", servicesRegistry.isStarted(A)); - assertTrue("service started", servicesRegistry.isStarted(B)); - assertTrue("service started", servicesRegistry.isStarted(C)); - - // Get names of created services - String nameA = ((FakeService) servicesRegistry.getService(A)).getName(); - String nameB = ((FakeService) servicesRegistry.getService(B)).getName(); - String nameC = ((FakeService) servicesRegistry.getService(C)).getName(); - // String nameD = ((FakeService)servicesRegistry.getService(D)).getName(); - // String nameE = ((FakeService)servicesRegistry.getService(E)).getName(); - // String nameF = ((FakeService)servicesRegistry.getService(F)).getName(); - - - // check order (E and F order are not guaranteed) - // order should be A, B, C - TestTrace trace = FakeService.getTrace(); - int i = 0; - assertEquals("order", nameA + ",create", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",create", trace.getNameTrace(i++)); - assertEquals("order", nameC + ",create", trace.getNameTrace(i++)); - // assertEquals("order", nameD + ",create", trace.getNameTrace(i++)); - // assertEquals("order", nameE + ",create", trace.getNameTrace(i++)); - - assertEquals("order", nameA + ",init", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",init", trace.getNameTrace(i++)); - assertEquals("order", nameC + ",init", trace.getNameTrace(i++)); - // assertEquals("order", nameD + ",init", trace.getNameTrace(i++)); - // assertEquals("order", nameE + ",init", trace.getNameTrace(i++)); - - assertEquals("order", nameA + ",start", trace.getNameTrace(i++)); - assertEquals("order", nameB + ",start", trace.getNameTrace(i++)); - assertEquals("order", nameC + ",start", trace.getNameTrace(i++)); - // assertEquals("order", nameD + ",start", trace.getNameTrace(i++)); - // assertEquals("order", nameE + ",start", trace.getNameTrace(i++)); - - } - - /* **************************************** */ - - - abstract static class TestServiceDescriptor extends ServiceDescriptor { - { - setClassBundleID("org.eclipse.papyrus.infra.core.tests"); - } - - public TestServiceDescriptor(Class key, String serviceClassname, ServiceStartKind serviceStartKind, int priority, boolean isAnonymous, List requiredServices) { - super(key, serviceClassname, serviceStartKind, priority, isAnonymous, requiredServices); - } - - public TestServiceDescriptor(Class key, String serviceClassname, ServiceStartKind serviceStartKind, int priority, List requiredServices) { - super(key, serviceClassname, serviceStartKind, priority, requiredServices); - } - - public TestServiceDescriptor(Class key, String serviceClassname, ServiceStartKind serviceStartKind, int priority) { - super(key, serviceClassname, serviceStartKind, priority); - } - - public TestServiceDescriptor(String serviceClassname, ServiceStartKind serviceStartKind, int priority, boolean isAnonymous) { - super(serviceClassname, serviceStartKind, priority, isAnonymous); - } - - public TestServiceDescriptor(String serviceClassname, ServiceStartKind serviceStartKind, int priority, List requiredServices) { - super(serviceClassname, serviceStartKind, priority, requiredServices); - } - - public TestServiceDescriptor(String serviceClassname, ServiceStartKind serviceStartKind, int priority) { - super(serviceClassname, serviceStartKind, priority); - } - - public TestServiceDescriptor(String key, String serviceClassname, ServiceStartKind serviceStartKind, int priority, boolean isAnonymous, List requiredServices) { - super(key, serviceClassname, serviceStartKind, priority, isAnonymous, requiredServices); - } - - public TestServiceDescriptor(String key, String serviceClassname, ServiceStartKind serviceStartKind, int priority, List requiredServices) { - super(key, serviceClassname, serviceStartKind, priority, requiredServices); - } - - public TestServiceDescriptor(String key, String serviceClassname, ServiceStartKind serviceStartKind, int priority) { - super(key, serviceClassname, serviceStartKind, priority); - } - - } - - - /** - * General purpose descriptor. - */ - public class ServiceDesc extends TestServiceDescriptor { - - - public ServiceDesc(String key, ServiceStartKind startKind) { - super(key, FakeService.class.getName(), startKind, 1); - } - - public ServiceDesc(String key, ServiceStartKind startKind, List requiredService) { - super(key, FakeService.class.getName(), startKind, 1, requiredService); - } - } - - /** - * General purpose descriptor. - */ - public static class ServiceFactoryDesc extends TestServiceDescriptor { - - - public ServiceFactoryDesc(String key, ServiceStartKind startKind) { - super(key, FakeServiceFactory.class.getName(), startKind, 1); - setServiceTypeKind(ServiceTypeKind.serviceFactory); - } - - public ServiceFactoryDesc(String key, ServiceStartKind startKind, List requiredService) { - super(key, FakeServiceFactory.class.getName(), startKind, 1, requiredService); - setServiceTypeKind(ServiceTypeKind.serviceFactory); - } - - /** - * Constructor with a classname and {@link ServiceDescriptor#isStartAtStartup()} = true. - * Constructor. - * - * @param key - * @param startKind - * @param requiredService - */ - public ServiceFactoryDesc(Class key, String classname, ServiceStartKind startKind, List requiredService) { - super(key, classname, startKind, 1, requiredService); - setServiceTypeKind(ServiceTypeKind.serviceFactory); - } - - /** - * Constructor with a classname and {@link ServiceDescriptor#isStartAtStartup()} = true. - * Constructor. - * - * @param key - * @param startKind - * @param requiredService - */ - public ServiceFactoryDesc(Class key, String classname, ServiceStartKind startKind) { - super(key, classname, startKind, 1); - setServiceTypeKind(ServiceTypeKind.serviceFactory); - } - - public ServiceFactoryDesc(String key, String serviceClassname, ServiceStartKind serviceStartKind, int priority, List requiredServices) { - super(key, serviceClassname, serviceStartKind, priority, requiredServices); - setServiceTypeKind(ServiceTypeKind.serviceFactory); - } - - public ServiceFactoryDesc(String key, String serviceClassname, ServiceStartKind serviceStartKind, int priority) { - super(key, serviceClassname, serviceStartKind, priority); - setServiceTypeKind(ServiceTypeKind.serviceFactory); - } - } - - /** - * - * @author dumoulin - * - */ - public class LazyServiceADescriptor extends TestServiceDescriptor { - - - public LazyServiceADescriptor() { - super(ServiceA.class.getName(), ServiceStartKind.LAZY, 1); - } - } - - public class LazyServiceA10Descriptor extends TestServiceDescriptor { - - - public LazyServiceA10Descriptor() { - super(ServiceA.class.getName(), ServiceA10.class.getName(), ServiceStartKind.LAZY, 10); - } - } - - public class LazyServiceBDescriptor extends TestServiceDescriptor { - - - public LazyServiceBDescriptor() { - super(ServiceB.class.getName(), ServiceStartKind.LAZY, 1); - } - } - - public class ServiceCDescriptor extends TestServiceDescriptor { - - - public ServiceCDescriptor() { - super(ServiceC.class.getName(), ServiceStartKind.STARTUP, 1); - } - } - - public class LazyServicePojoADescriptor extends TestServiceDescriptor { - - - public LazyServicePojoADescriptor() { - super(ServicePojoA.class.getName(), ServiceStartKind.LAZY, 1); - } - } - - public class PojoServiceDescriptor extends TestServiceDescriptor { - - - public PojoServiceDescriptor() { - super(Object.class.getName(), ServiceStartKind.STARTUP, 1); - } - } - - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/SharedServiceFactoryTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/SharedServiceFactoryTest.java deleted file mode 100644 index 78424bb56b4..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/SharedServiceFactoryTest.java +++ /dev/null @@ -1,399 +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.infra.core.services; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.CoreMatchers.sameInstance; -import static org.hamcrest.MatcherAssert.assertThat; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import java.util.List; -import java.util.Random; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.stream.Collectors; -import java.util.stream.IntStream; -import java.util.stream.Stream; - -import org.eclipse.papyrus.junit.utils.rules.AnnotationRule; -import org.junit.After; -import org.junit.Assume; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; - -/** - * Test cases for the {@link SharedServiceFactory} class. Tests annotated with - * {@link Parallel @Parallel} operate on multiple service registries in parallel - * and the initialization and finalization of services in parallel tests have - * random short delays to try to mix things up for each execution. - */ -public class SharedServiceFactoryTest { - private static final int DEFAULT_REGISTRY_COUNT = 3; - - private static Synchronizer sync; - - @Rule - public final AnnotationRule registryCount = AnnotationRule.create(Registries.class, DEFAULT_REGISTRY_COUNT); - - @Rule - public final AnnotationRule parallelRegistries = AnnotationRule.createExists(Parallel.class); - - private List registries; - - public SharedServiceFactoryTest() { - super(); - } - - @Test - public void uniqueServiceInstances() { - registries().forEach(this::start); - - assertUniqueServiceInstance(Service1.class, Service1Impl.class); - assertUniqueServiceInstance(Service2.class, Service2Impl.class); - } - - @Test - public void serviceNotInitialized() { - registries().forEach(this::start); - - Service1Impl s1 = assumeUniqueServiceInstance(Service1.class, Service1Impl.class); - assertThat(s1.initializedCount.get(), is(0)); - } - - @Test - public void serviceStartedOnce() { - registries().forEach(this::start); - - Service1Impl s1 = assumeUniqueServiceInstance(Service1.class, Service1Impl.class); - assertThat(s1.startedCount.get(), is(1)); - - Service2Impl s2 = assumeUniqueServiceInstance(Service2.class, Service2Impl.class); - assertThat(s2.startedCount.get(), is(1)); - } - - @Test - public void serviceDisposedOnce() { - registries().forEach(this::start); - - Service1Impl s1 = assumeUniqueServiceInstance(Service1.class, Service1Impl.class); - Service2Impl s2 = assumeUniqueServiceInstance(Service2.class, Service2Impl.class); - - destroyFixture(); - - assertThat(s1.disposedCount.get(), is(1)); - assertThat(s2.disposedCount.get(), is(1)); - } - - @Test - public void servicesRecreated() { - registries().forEach(this::start); - - Service1Impl s1 = assumeUniqueServiceInstance(Service1.class, Service1Impl.class); - Service2Impl s2 = assumeUniqueServiceInstance(Service2.class, Service2Impl.class); - - destroyFixture(); - createFixture(); - registries().forEach(this::start); - - Service1Impl s1_ = assumeUniqueServiceInstance(Service1.class, Service1Impl.class); - Service2Impl s2_ = assumeUniqueServiceInstance(Service2.class, Service2Impl.class); - - assertThat(s1, not(sameInstance(s1_))); - assertThat(s2, not(sameInstance(s2_))); - } - - @Registries(64) - @Parallel - @Test - public void parallelAccess() { - // Do a few iterations of this test - for (int i = 0; i < 5; i++) { - if (i > 0) { - // We destroyed the fixture the last time around - createFixture(); - } - - registries().forEach(this::start); - - Service1Impl s1 = assumeUniqueServiceInstance(Service1.class, Service1Impl.class); - Service2Impl s2 = assumeUniqueServiceInstance(Service2.class, Service2Impl.class); - Service3Impl s3 = assumeUniqueServiceInstance(Service3.class, Service3Impl.class); - - destroyFixture(); - - assertThat(s1.startedCount.get(), is(1)); - assertThat(s1.disposedCount.get(), is(1)); - - assertThat(s2.startedCount.get(), is(1)); - assertThat(s2.disposedCount.get(), is(1)); - - assertThat(s3.startedCount.get(), is(1)); - assertThat(s3.disposedCount.get(), is(1)); - } - } - - // - // Test framework - // - - @Before - public void createFixture() { - if (parallelRegistries.get()) { - sync = new ParallelSynchronizer(); - } else { - // No-op synchronizer - sync = () -> { - }; - } - - registries = createServiceRegistries(registryCount.get()); - } - - @After - public void destroyFixture() { - if (registries != null) { - try { - registries().forEach(this::dispose); - } finally { - registries = null; - } - } - - sync = null; - } - - Stream registries() { - return parallelRegistries.get() ? registries.parallelStream() : registries.stream(); - } - - T assertUniqueServiceInstance(Class serviceInterface, Class serviceImpl) { - List result = registries() - .map(r -> getService(r, serviceInterface)) - .distinct() - .collect(Collectors.toList()); - assertThat(result.size(), is(1)); - return serviceImpl.cast(result.get(0)); - } - - T assumeUniqueServiceInstance(Class serviceInterface, Class serviceImpl) { - List result = registries() - .map(r -> getService(r, serviceInterface)) - .distinct() - .collect(Collectors.toList()); - Assume.assumeThat(result.size(), is(1)); - return serviceImpl.cast(result.get(0)); - } - - S getService(ServicesRegistry registry, Class serviceInterface) { - try { - return registry.getService(serviceInterface); - } catch (ServiceException e) { - throw new RuntimeException(e); - } - } - - List createServiceRegistries(int count) { - return IntStream.range(0, count).mapToObj(__ -> createServicesRegistry()).collect(Collectors.toList()); - } - - ServicesRegistry createServicesRegistry() { - ServicesRegistry result = new ServicesRegistry(); - result.add(new ServicesRegistryTest.ServiceFactoryDesc(Service1.class, Service1Factory.class.getName(), ServiceStartKind.LAZY)); - result.add(new ServicesRegistryTest.ServiceFactoryDesc(Service2.class, Service2Factory.class.getName(), ServiceStartKind.LAZY)); - result.add(new ServicesRegistryTest.ServiceFactoryDesc(Service3.class, Service3Factory.class.getName(), ServiceStartKind.LAZY)); - return result; - } - - void start(ServicesRegistry registry) { - try { - registry.startRegistry(); - } catch (ServiceException e) { - throw new RuntimeException(e); - } - } - - void dispose(ServicesRegistry registry) { - try { - registry.disposeRegistry(); - } catch (ServiceException e) { - throw new RuntimeException(e); - } - } - - public interface Service1 extends IService { - // Nothing more - } - - static class Service1Impl implements Service1 { - AtomicInteger initializedCount = new AtomicInteger(); - AtomicInteger startedCount = new AtomicInteger(); - AtomicInteger disposedCount = new AtomicInteger(); - - { - sync.sync(); - } - - @Override - public void init(ServicesRegistry servicesRegistry) throws ServiceException { - initializedCount.incrementAndGet(); - } - - @Override - public void startService() throws ServiceException { - sync.sync(); - startedCount.incrementAndGet(); - } - - @Override - public void disposeService() throws ServiceException { - sync.sync(); - disposedCount.incrementAndGet(); - } - - } - - public static class Service1Factory extends SharedServiceFactory { - - public Service1Factory() { - super(Service1.class, Service1Impl::new); - } - - } - - public interface Service2 { - // Empty - } - - static class Service2Impl implements Service2 { - AtomicInteger startedCount = new AtomicInteger(); - AtomicInteger disposedCount = new AtomicInteger(); - - { - sync.sync(); - } - - void start() throws ServiceException { - sync.sync(); - startedCount.incrementAndGet(); - } - - void dispose() throws ServiceException { - sync.sync(); - disposedCount.incrementAndGet(); - } - - } - - public static class Service2Factory extends SharedServiceFactory { - - public Service2Factory() { - super(Service2.class); - } - - @Override - protected Service2 createSharedInstance() { - return new Service2Impl(); - } - - @Override - protected void start(Service2 sharedInstance) throws ServiceException { - ((Service2Impl) sharedInstance).start(); - } - - @Override - protected void dispose(Service2 sharedInstance) throws ServiceException { - ((Service2Impl) sharedInstance).dispose(); - } - } - - public interface Service3 { - // Empty - } - - static class Service3Impl implements Service3 { - AtomicInteger startedCount = new AtomicInteger(); - AtomicInteger disposedCount = new AtomicInteger(); - - { - sync.sync(); - } - - void start() throws ServiceException { - sync.sync(); - startedCount.incrementAndGet(); - } - - void dispose() throws ServiceException { - sync.sync(); - disposedCount.incrementAndGet(); - } - - } - - public static class Service3Factory extends SharedServiceFactory { - - public Service3Factory() { - super(Service3.class, Service3Impl::new); - } - - @Override - protected void start(Service3 sharedInstance) throws ServiceException { - ((Service3Impl) sharedInstance).start(); - } - - @Override - protected void dispose(Service3 sharedInstance) throws ServiceException { - ((Service3Impl) sharedInstance).dispose(); - } - } - - @Target({ ElementType.TYPE, ElementType.METHOD }) - @Retention(RetentionPolicy.RUNTIME) - public @interface Registries { - int value() default DEFAULT_REGISTRY_COUNT; - } - - @Target({ ElementType.TYPE, ElementType.METHOD }) - @Retention(RetentionPolicy.RUNTIME) - public @interface Parallel { - // Empty - } - - @FunctionalInterface - interface Synchronizer { - void sync(); - } - - /** - * A synchronizer that introduces short random delays into the - * execution of a parallel test case. - */ - static final class ParallelSynchronizer implements Synchronizer { - final Random random = new Random(System.currentTimeMillis()); - - @Override - public void sync() { - try { - Thread.sleep(random.nextInt(100) + 20L); - } catch (Exception e) { - e.printStackTrace(); - // Never mind. Just proceed - } - } - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/TestTrace.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/TestTrace.java deleted file mode 100644 index ab960a90f89..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/TestTrace.java +++ /dev/null @@ -1,181 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.infra.core.services; - -import java.util.ArrayList; -import java.util.List; - - -/** - * A class used to record traces for tests - * - * @author cedric dumoulin - * - */ -public class TestTrace { - - public Listtraces = new ArrayList(); - - /** - * Record a new trace. - * @param trace - */ - public void addTrace(String trace) { - addTrace(null, trace, null); - } - - /** - * Record a new trace. - * @param trace - */ - public void addTrace(String name, String trace) { - addTrace(name, trace, null); - } - - /** - * Record a new trace. - * @param trace - */ - public void addTrace(String name, String trace, Object value) { - traces.add(new TraceRecord( name, trace, value)); - } - - /** - * Return the name and the trace in one concatenated string ("name,trace"). - * @param i Index of the requested trace - * @return - */ - public String getNameTrace(int i) { - return traces.get(i).getNameTrace(); - } - - /** - * Get the value - * @param i - * @return - */ - public Object getValue(int i) { - return traces.get(i).value; - } - - /** - * Return true if the trace contains the specified events. - * @return - */ - public boolean contains( String name, String trace) { - - return indexOfNameTrace(name, trace) >= 0; - } - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public int indexOf(String name, String trace, Object value) { - - for (int i = 0; i < traces.size(); i++) { - TraceRecord record = traces.get(i); - - if( name.equals(record.name) && trace.equals(record.trace) ) - return i; - } - - return -1; - } - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public int indexOfNameTrace(String name, String trace) { - - for (int i = 0; i < traces.size(); i++) { - TraceRecord record = traces.get(i); - - if( name.equals(record.name) && trace.equals(record.trace) ) - return i; - } - - return -1; - } - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public int indexOfTrace(String trace) { - - for (int i = 0; i < traces.size(); i++) { - TraceRecord record = traces.get(i); - - if( trace.equals(record.trace) ) - return i; - } - - return -1; - } - - /** - * Returns the index of the first occurrence of the specified elements - * in these lists, or -1 if this list does not contain the element. - */ - public int indexOfName(String name) { - - for (int i = 0; i < traces.size(); i++) { - TraceRecord record = traces.get(i); - - if( name.equals(record.name) ) - return i; - } - - return -1; - } - - /** - * Reset the trace. - */ - public void reset() { - traces.clear(); - } - - - /** - * @return the traces - */ - public List getTraces() { - return traces; - } - - /** - * A Record of the trace. - */ - public class TraceRecord { - public String name; - public String trace; - public Object value; - /** - * Constructor. - * - * @param name - * @param trace - * @param value - */ - public TraceRecord(String name, String trace, Object value) { - this.name = name; - this.trace = trace; - this.value = value; - } - - /** - * - * @return - */ - public String getNameTrace() { - // TODO Auto-generated method stub - return name + "," + trace; - } - - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/tests/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/tests/AllTests.java deleted file mode 100644 index 9c4476c3738..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/tests/AllTests.java +++ /dev/null @@ -1,57 +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 LIST) - add test for AdapterUtils - * Christian W. Damus (CEA) - bugs 402525, 422257, 399859 - * Christian W. Damus - bugs 456934, 468030, 482949, 485220, 488558, 498140 - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.core.tests; - -import org.eclipse.papyrus.infra.core.language.LanguageServiceTest; -import org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResourceTest; -import org.eclipse.papyrus.infra.core.resource.ModelSetTest; -import org.eclipse.papyrus.infra.core.resource.NestingTransactionalCommandStackTest; -import org.eclipse.papyrus.infra.core.resource.ResourceAdapterTest; -import org.eclipse.papyrus.infra.core.resource.ResourceAdapterTransactionalTest; -import org.eclipse.papyrus.infra.core.services.ComposedServiceTest; -import org.eclipse.papyrus.infra.core.services.ServicesRegistryTest; -import org.eclipse.papyrus.infra.core.services.SharedServiceFactoryTest; -import org.eclipse.papyrus.infra.core.utils.AdapterUtilsTest; -import org.eclipse.papyrus.infra.core.utils.JobBasedFutureTest; -import org.eclipse.papyrus.infra.core.utils.JobExecutorServiceTest; -import org.eclipse.papyrus.infra.core.utils.TransactionHelperTest; -import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; -import org.eclipse.papyrus.junit.framework.runner.Headless; -import org.junit.runner.RunWith; -import org.junit.runners.Suite.SuiteClasses; - - - -@Headless -@RunWith(ClassificationSuite.class) -@SuiteClasses({ - // {oep.resource} - ModelSetTest.class, AbstractModelWithSharedResourceTest.class, NestingTransactionalCommandStackTest.class, - ResourceAdapterTest.class, ResourceAdapterTransactionalTest.class, - // {oep}.core.language - LanguageServiceTest.class, - // {oep}.core.services - ComposedServiceTest.class, ServicesRegistryTest.class, SharedServiceFactoryTest.class, - // {oep}.core.utils - AdapterUtilsTest.class, JobBasedFutureTest.class, JobExecutorServiceTest.class, - TransactionHelperTest.class, -}) -/** - * Suite Class for all tests in the plugin - */ -public class AllTests { - // Junit 4 Test suite -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/AdapterUtilsTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/AdapterUtilsTest.java deleted file mode 100644 index e1951316491..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/AdapterUtilsTest.java +++ /dev/null @@ -1,170 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 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.infra.core.utils; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.junit.Assert.assertThat; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.hamcrest.BaseMatcher; -import org.hamcrest.Description; -import org.hamcrest.Matcher; -import org.junit.Test; - -import com.google.common.base.Optional; - - -/** - * Tests for the {@link AdapterUtils} class. - */ -public class AdapterUtilsTest extends AbstractPapyrusTest { - - @Test - public void testAdaptInstanceOptionalPresent() { - String foo = "foo"; - - assertThat(AdapterUtils.adapt(foo, String.class), isPresent(String.class)); - } - - @Test - public void testAdaptAdaptableOptionalPresent() { - String foo = "foo"; - - assertThat(AdapterUtils.adapt(new AdaptableWrapper(foo), String.class), isPresent(String.class)); - } - - @Test - public void testAdaptEMFOptionalPresent() { - EObject obj = EcoreFactory.eINSTANCE.createEObject(); - new EMFAdapter(obj); - - assertThat(AdapterUtils.adapt(obj, EMFAdapter.class), isPresent(EMFAdapter.class)); - } - - @Test - public void testAdaptInstanceOptionalNull() { - String foo = "foo"; - - assertThat(AdapterUtils.adapt(foo, Integer.class), isNull(Integer.class)); - } - - @Test - public void testAdaptAdaptableOptionalNull() { - String foo = "foo"; - - assertThat(AdapterUtils.adapt(new AdaptableWrapper(foo), Integer.class), isNull(Integer.class)); - } - - @Test - public void testAdaptEMFOptionalNull() { - EObject obj = EcoreFactory.eINSTANCE.createEObject(); - - assertThat(AdapterUtils.adapt(obj, EMFAdapter.class), isNull(EMFAdapter.class)); - } - - @Test - public void testAdaptInstanceDefaultPresent() { - String foo = "foo"; - - assertThat(AdapterUtils.adapt(foo, String.class, null), is(foo)); - } - - @Test - public void testAdaptAdaptableDefaultPresent() { - String foo = "foo"; - - assertThat(AdapterUtils.adapt(new AdaptableWrapper(foo), String.class, null), is(foo)); - } - - @Test - public void testAdaptEMFDefaultPresent() { - EObject obj = EcoreFactory.eINSTANCE.createEObject(); - EMFAdapter emf = new EMFAdapter(obj); - - assertThat(AdapterUtils.adapt(obj, EMFAdapter.class, null), is(emf)); - } - - @Test - public void testAdaptAdaptableDefaultDefault() { - String foo = "foo"; - - assertThat(AdapterUtils.adapt(new AdaptableWrapper(foo), Integer.class, 42), is(42)); - } - - @Test - public void testAdaptAdaptableDefaultNull() { - String foo = "foo"; - - assertThat(AdapterUtils.adapt(new AdaptableWrapper(foo), Integer.class, null), nullValue()); - } - - // - // Test framework - // - - static Matcher> isPresent(Class type) { - return new BaseMatcher>() { - - public void describeTo(Description description) { - description.appendText("optional value is present"); - } - - public boolean matches(Object item) { - return (item instanceof Optional) && ((Optional)item).isPresent(); - } - }; - } - - static Matcher> isNull(Class type) { - return not(isPresent(type)); - } - - public static class AdaptableWrapper implements IAdaptable { - - private final Class type; - - private final Object instance; - - public AdaptableWrapper(T instance, Class type) { - this.type = type; - this.instance = instance; - } - - public AdaptableWrapper(Object instance) { - this.type = instance.getClass(); - this.instance = instance; - } - - public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) { - return (adapter == type) ? instance : null; - } - } - - public static class EMFAdapter extends AdapterImpl { - - public EMFAdapter(Notifier obj) { - obj.eAdapters().add(this); - } - - @Override - public boolean isAdapterForType(Object type) { - return type == EMFAdapter.class; - } - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobBasedFutureTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobBasedFutureTest.java deleted file mode 100644 index 5047dd18394..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobBasedFutureTest.java +++ /dev/null @@ -1,331 +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.infra.core.utils; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.fail; - -import java.util.Collections; -import java.util.List; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.jobs.ISchedulingRule; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; -import org.eclipse.papyrus.junit.matchers.MoreMatchers; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -import com.google.common.base.Supplier; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; -import com.google.common.util.concurrent.FutureCallback; -import com.google.common.util.concurrent.Futures; - -/** - * JUnit tests for the {@link JobBasedFuture} class. - */ -public class JobBasedFutureTest extends AbstractPapyrusTest { - private static final long FUTURE_DURATION = 3L; - - private static final TimeUnit FUTURE_DURATION_UNIT = TimeUnit.SECONDS; - - private static final int CONCURRENT_THREAD_COUNT = 3; - - private static ExecutorService exec; - - private long startedWhen; - - public JobBasedFutureTest() { - super(); - } - - @Test - public void normalCompletion() { - runGetterThreads(Fixture.returning(true)); - assertRunningTimeAtLeast(2L, TimeUnit.SECONDS); - } - - @Test - public void normalCompletionWithSchedulingRule() { - runGetterThreads(Fixture.returning(true), new RuleSupplier()); - assertRunningTimeAtLeast(2L, TimeUnit.SECONDS); - } - - @Test - public void timeOut() { - runGetterThreads(Fixture.returning(true, 5L, TimeUnit.SECONDS), 2L, TimeUnit.SECONDS); - } - - @Test - public void timeOutWithSchedulingRule() { - runGetterThreads(Fixture.returning(true, 5L, TimeUnit.SECONDS), 2L, TimeUnit.SECONDS, new RuleSupplier()); - } - - @Test - public void computeFails() { - runGetterThreads(Fixture.throwing(TestException.class), TestException.class); - assertRunningTimeAtLeast(2L, TimeUnit.SECONDS); - } - - @Test - public void cancel() { - runGetterThreads(Fixture.returning(true), true); - } - - @Test - public void listen_success() { - addListeners(Fixture.returning(true)); - } - - @Test - public void listen_failure() { - addListeners(Fixture.throwing(TestException.class), TestException.class); - } - - // - // Test framework - // - - @BeforeClass - public static void createExecutor() { - exec = Executors.newCachedThreadPool(); - } - - @AfterClass - public static void shutDownExecutor() { - exec.shutdown(); - exec = null; - } - - @Before - public void starting() { - startedWhen = System.currentTimeMillis(); - } - - void assertRunningTimeAtLeast(long time, TimeUnit unit) { - assertThat("Test running time too short", System.currentTimeMillis() - startedWhen, MoreMatchers.greaterThan(unit.toMillis(time))); - } - - void runGetterThreads(final Fixture fixture) { - runGetterThreads(fixture, 0L, null, null, false, true, null); - } - - void runGetterThreads(final Fixture fixture, Supplier rule) { - runGetterThreads(fixture, 0L, null, rule, false, true, null); - } - - void runGetterThreads(final Fixture fixture, long timeout, TimeUnit unit) { - runGetterThreads(fixture, timeout, unit, null, false, null, TimeoutException.class); - } - - void runGetterThreads(final Fixture fixture, long timeout, TimeUnit unit, Supplier rule) { - runGetterThreads(fixture, timeout, unit, rule, false, null, null); - } - - void runGetterThreads(final Fixture fixture, Boolean expected) { - runGetterThreads(fixture, 0L, null, null, false, expected, null); - } - - void runGetterThreads(final Fixture fixture, boolean cancel) { - runGetterThreads(fixture, 0L, null, null, true, null, null); - } - - void runGetterThreads(final Fixture fixture, Class expectedException) { - runGetterThreads(fixture, 0L, null, null, false, null, expectedException); - } - - private void runGetterThreads(final Fixture fixture, final long timeout, final TimeUnit unit, final Supplier rule, final boolean cancel, Boolean expected, Class expectedException) { - final List results = Lists.newCopyOnWriteArrayList(); - final List thrown = Lists.newCopyOnWriteArrayList(); - final CountDownLatch latch = new CountDownLatch(CONCURRENT_THREAD_COUNT); - - Runnable reader = new Runnable() { - - public void run() { - ISchedulingRule rule_ = (rule == null) ? null : rule.get(); - - try { - if (rule_ != null) { - Job.getJobManager().beginRule(rule_, null); - } - - if (cancel) { - fixture.cancel(true); - } else if (timeout <= 0L) { - results.add(fixture.get()); - } else { - results.add(fixture.get(timeout, unit)); - } - } catch (InterruptedException e) { - thrown.add(e); - } catch (TimeoutException e) { - thrown.add(e); - } catch (ExecutionException e) { - thrown.add(e.getCause()); - } finally { - latch.countDown(); - - if (rule_ != null) { - Job.getJobManager().endRule(rule_); - } - } - } - }; - - for (int i = 0; i < CONCURRENT_THREAD_COUNT; i++) { - exec.submit(reader); - } - - try { - assertThat("Test timed out", latch.await(10L, TimeUnit.MINUTES), is(true)); - } catch (InterruptedException e) { - e.printStackTrace(); - fail("Interrupted waiting for test threads"); - } - - assertThat(results, is((expected == null) ? Collections. emptyList() : Collections.nCopies(CONCURRENT_THREAD_COUNT, expected))); - - if (expectedException != null) { - assertThat(Iterables.size(Iterables.filter(thrown, expectedException)), is(CONCURRENT_THREAD_COUNT)); - } - } - - void addListeners(final Fixture fixture) { - addListeners(fixture, true, null); - } - - void addListeners(final Fixture fixture, Class expectedException) { - addListeners(fixture, null, expectedException); - } - - private void addListeners(final Fixture fixture, Boolean expected, Class expectedException) { - final List results = Lists.newCopyOnWriteArrayList(); - final List thrown = Lists.newCopyOnWriteArrayList(); - final CountDownLatch latch = new CountDownLatch(CONCURRENT_THREAD_COUNT); - - for (int i = 0; i < CONCURRENT_THREAD_COUNT; i++) { - Futures.addCallback(fixture, new FutureCallback() { - public void onSuccess(Boolean result) { - results.add(result); - latch.countDown(); - } - - public void onFailure(Throwable t) { - thrown.add(t); - latch.countDown(); - } - }); - } - - try { - assertThat("Test timed out", latch.await(1L, TimeUnit.MINUTES), is(true)); - } catch (InterruptedException e) { - e.printStackTrace(); - fail("Interrupted waiting for test listeners"); - } - - assertThat(results, is((expected == null) ? Collections. emptyList() : Collections.nCopies(CONCURRENT_THREAD_COUNT, expected))); - - if (expectedException != null) { - assertThat(Iterables.size(Iterables.filter(thrown, expectedException)), is(CONCURRENT_THREAD_COUNT)); - } - - } - - private static class Fixture extends JobBasedFuture { - private final long delay; - private final TimeUnit delayUnit; - - private boolean value = true; - private Class exception; - - Fixture(long delay, TimeUnit delayUnit) { - super("Test fixture"); - - this.delay = delay; - this.delayUnit = delayUnit; - } - - @Override - protected Boolean compute(IProgressMonitor monitor) throws Exception { - if (delay > 0L) { - delayUnit.sleep(delay); - } - - if (exception != null) { - if (Exception.class.isAssignableFrom(exception)) { - throw (Exception) exception.newInstance(); - } else if (Error.class.isAssignableFrom(exception)) { - throw (Error) exception.newInstance(); - } - } - - return value; - } - - static Fixture returning(boolean value) { - return returning(value, FUTURE_DURATION, FUTURE_DURATION_UNIT); - } - - static Fixture returning(boolean value, long delay, TimeUnit unit) { - Fixture result = new Fixture(delay, unit); - result.value = value; - result.schedule(); - return result; - } - - static Fixture throwing(Class exception) { - return throwing(exception, FUTURE_DURATION, FUTURE_DURATION_UNIT); - } - - static Fixture throwing(Class exception, long delay, TimeUnit unit) { - Fixture result = new Fixture(delay, unit); - result.exception = exception; - result.schedule(); - return result; - } - } - - static class TestException extends Exception { - private static final long serialVersionUID = 1L; - - public TestException() { - super(); - } - } - - static class RuleSupplier implements Supplier { - public ISchedulingRule get() { - return new ISchedulingRule() { - public boolean isConflicting(ISchedulingRule rule) { - return rule == this; - } - - public boolean contains(ISchedulingRule rule) { - return rule == this; - } - }; - } - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobExecutorServiceTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobExecutorServiceTest.java deleted file mode 100644 index 2259848c31f..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobExecutorServiceTest.java +++ /dev/null @@ -1,145 +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.infra.core.utils; - -import static org.hamcrest.CoreMatchers.hasItem; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -import java.util.List; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.TimeUnit; - -import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; -import org.junit.Rule; -import org.junit.Test; - -/** - * Automated tests for the {@link JobExecutorService} class. - */ -public class JobExecutorServiceTest { - - @Rule - public final HouseKeeper houseKeeper = new HouseKeeper(); - - public JobExecutorServiceTest() { - super(); - } - - @Test - public void executeAndShutDown() throws Exception { - ExecutorService exec = createFixture(); - - LatchedRunnable run1 = new LatchedRunnable(); - LatchedRunnable run2 = new LatchedRunnable(); - - exec.execute(run1); - exec.execute(run2); - - run1.release(); - run2.release(); - - run1.assertDone(); - run2.assertDone(); - - exec.shutdown(); - assertTerminated(exec); - } - - @Test - public void executeAndShutDownNow() throws Exception { - ExecutorService exec = createFixture(); - - LatchedRunnable run1 = new LatchedRunnable(); - LatchedRunnable run2 = new LatchedRunnable(); - - exec.execute(run1); - exec.execute(run2); - - // Do not release the runnables! - - List pending = exec.shutdownNow(); - - assertShutdown(exec); - assertThat(pending, hasItem(run2)); // Serial execution didn't get this far - - run1.assertNotDone(); - run2.assertNotDone(); - - // Just to clean up - run1.release(); - run2.release(); - - assertTerminated(exec); - } - - // - // Test framework - // - - ExecutorService createFixture() { - return houseKeeper.cleanUpLater(new JobExecutorService(), "shutdownNow"); - } - - void assertShutdown(ExecutorService executorService) throws Exception { - assertThat("Executor not terminated", executorService.isShutdown(), is(true)); - } - - void assertTerminated(ExecutorService executorService) throws Exception { - assertThat("Executor not shut down", executorService.awaitTermination(1L, TimeUnit.SECONDS), is(true)); - assertShutdown(executorService); - assertThat("Executor not terminated", executorService.isTerminated(), is(true)); - } - - static class LatchedRunnable implements Runnable { - private final CountDownLatch startLatch = new CountDownLatch(1); - private final CountDownLatch doneLatch = new CountDownLatch(1); - - private volatile boolean interrupted; - private volatile boolean done; - - public void run() { - try { - startLatch.await(); - - done = true; - doneLatch.countDown(); - } catch (InterruptedException e) { - interrupted = true; - } - } - - void release() { - startLatch.countDown(); - } - - void assertNotInterrupted() { - assertThat("Runnable was interrupted", interrupted, is(false)); - } - - void assertDone() throws InterruptedException { - assertNotInterrupted(); - - doneLatch.await(1L, TimeUnit.SECONDS); - assertThat("Runnable not done", done, is(true)); - } - - void assertNotDone() throws InterruptedException { - assertNotInterrupted(); - - assertThat("Runnable is done", done, is(false)); - } - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/TransactionHelperTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/TransactionHelperTest.java deleted file mode 100644 index 6499866a806..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/TransactionHelperTest.java +++ /dev/null @@ -1,194 +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.infra.core.utils; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.fail; - -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.function.Consumer; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.papyrus.infra.tools.util.IProgressCallable; -import org.eclipse.papyrus.infra.tools.util.IProgressRunnable; -import org.eclipse.papyrus.junit.utils.PrintingProgressMonitor; -import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.Test; - -/** - * Automated tests for the {@link TransactionHelper} class. - */ -public class TransactionHelperTest { - - private static ExecutorService exec; - - @Rule - public final HouseKeeper houseKeeper = new HouseKeeper(); - - private TransactionalEditingDomain domain; - private EClass eclass; - - /** - * Initializes me. - */ - public TransactionHelperTest() { - super(); - } - - @Test - public void testPrivilegedProgressRunnable() { - IProgressRunnable runnable = monitor -> { - monitor.beginTask("Test privileged runnable", 2); - - eclass.setAbstract(true); - monitor.worked(1); - eclass.setName("Foo"); - monitor.worked(1); - - monitor.done(); - }; - - FailureAssertion failure = new FailureAssertion(); - domain.getCommandStack().execute(new RecordingCommand(domain, "Test") { - - @Override - protected void doExecute() { - IProgressRunnable privileged = TransactionHelper.createPrivilegedRunnable(domain, runnable); - Future future = submit(privileged); - - // And synchronize with it - try { - future.get(); - } catch (Exception e) { - failure.accept(e); - } - } - }); - - failure.verify(); - - assertThat(eclass.isAbstract(), is(true)); - assertThat(eclass.getName(), is("Foo")); - } - - @Test - public void testPrivilegedProgressCallable() { - IProgressCallable callable = monitor -> { - monitor.beginTask("Test privileged callable", 2); - - eclass.setAbstract(true); - monitor.worked(1); - eclass.setName("Foo"); - monitor.worked(1); - - monitor.done(); - - return eclass.getName(); - }; - - FailureAssertion failure = new FailureAssertion(); - domain.getCommandStack().execute(new RecordingCommand(domain, "Test") { - - @Override - protected void doExecute() { - IProgressCallable privileged = TransactionHelper.createPrivilegedCallable(domain, callable); - Future future = submit(privileged); - - // And synchronize with it - try { - String newName = future.get(); - assertThat(newName, is("Foo")); - } catch (Exception e) { - failure.accept(e); - } - } - }); - - failure.verify(); - - assertThat(eclass.isAbstract(), is(true)); - assertThat(eclass.getName(), is("Foo")); - } - - // - // Test framework - // - - @BeforeClass - public static void createExecutorService() { - exec = Executors.newSingleThreadExecutor(); - } - - @Before - public void createFixture() throws Exception { - domain = houseKeeper.createSimpleEditingDomain(); - Resource res = domain.createResource("file:bogus.ecore"); - - TransactionHelper.run(domain, () -> { - EPackage epackage = EcoreFactory.eINSTANCE.createEPackage(); - res.getContents().add(epackage); - eclass = EcoreFactory.eINSTANCE.createEClass(); - epackage.getEClassifiers().add(eclass); - }); - } - - @AfterClass - public static void shutdownExecutorService() { - exec.shutdown(); - exec = null; - } - - Future submit(IProgressCallable callable) { - return exec.submit(() -> callable.call(new PrintingProgressMonitor())); - } - - Future submit(IProgressRunnable runnable) { - return exec.submit(() -> runnable.run(new PrintingProgressMonitor())); - } - - // - // Nested types - // - - private static final class FailureAssertion implements Consumer { - private Throwable thrown; - - @Override - public void accept(Throwable t) { - // Take only the first one - if (thrown == null) { - thrown = t; - } - } - - void verify() { - if (thrown != null) { - thrown.printStackTrace(); - fail("Synchronization on future result failed: " + thrown.getMessage()); - } - } - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/.classpath b/tests/junit/plugins/core/org.eclipse.papyrus.tests/.classpath deleted file mode 100644 index 83be1d9f78c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/.project b/tests/junit/plugins/core/org.eclipse.papyrus.tests/.project deleted file mode 100644 index 979bedcae53..00000000000 --- a/tests/junit/plugins/core/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/core/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/core/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 62a08f4494d..00000000000 --- a/tests/junit/plugins/core/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/core/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/core/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/tests/junit/plugins/core/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/core/org.eclipse.papyrus.tests/AllTestsWithMemoryDump.launch b/tests/junit/plugins/core/org.eclipse.papyrus.tests/AllTestsWithMemoryDump.launch deleted file mode 100644 index 028d768c36a..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/AllTestsWithMemoryDump.launch +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 06836d338ba..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,97 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.common.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.services.resourceloading.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.service.types.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.clazz.tests;bundle-version="1.2.0", - org.eclipse.papyrus.bundles.tests;bundle-version="1.2.0", - org.eclipse.papyrus.views.modelexplorer.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.activity.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.deployment.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.component.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.usecase.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.statemachine.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.communication.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.dnd.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.emf.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.services.edit;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.sasheditor.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.sasheditor.di.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.services.labelprovider.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.timing.tests;bundle-version="1.2.0", - org.eclipse.papyrus.editor.integration.tests;bundle-version="1.2.0", - org.eclipse.papyrus.search.tests;bundle-version="1.2.0", - org.junit;bundle-version="4.10.0", - org.eclipse.papyrus.uml.tools.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.tools.utils.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.nattable.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.nattable.clazz.config.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.nattable.model.editor.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.sequence.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.interactionoverview.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.composite.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.gmfdiag.css.tests;bundle-version="1.2.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", - org.eclipse.papyrus.infra.emf.readonly.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.gmfdiag.common.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.tools.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.wizards.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.modelrepair.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.profile.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.profile.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.services.controlmode.tests;bundle-version="1.2.0", - org.eclipse.papyrus.junit.framework;bundle-version="1.2.0", - org.eclipse.papyrus.infra.nattable.tests;bundle-version="1.2.0", - org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", - org.eclipse.papyrus.infra.nattable.views.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.nattable.generic.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.modelexplorer.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.textedit.port.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.textedit.property.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.textedit.parameter.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.decoratormodel.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.decoratormodel.controlmode.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.gmfdiag.menu.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.nattable.model.tests;bundle-version="1.2.0", - org.eclipse.papyrus.tests.diagramassistants;bundle-version="1.2.0", - org.eclipse.papyrus.uml.profile.drafter.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.gmfdiag.canonical.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.alf.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.textedit.valuespecification.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.viewpoints.configuration.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.clipboard.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.nattable.stereotype.display.tests;bundle-version="1.2.0", - org.eclipse.papyrus.tests.framework;bundle-version="1.2.0", - org.eclipse.xtend.lib;bundle-version="2.8.1", - org.eclipse.papyrus.infra.nattable.common.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.editor.welcome.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.gmfdiag.welcome.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.validation.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.ui.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.ui.emf.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.services.edit.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.services.edit.ui.tests;bundle-version="1.2.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", - org.eclipse.papyrus.uml.service.types.ui.tests;bundle-version="1.2.0", - org.eclipse.papyrus.eclipse.project.editors.tests;bundle-version="2.0.0", - org.eclipse.papyrus.infra.emf.gmf.tests;bundle-version="1.2.1", - org.eclipse.papyrus.infra.internationalization.tests;bundle-version="1.0.0", - org.eclipse.papyrus.infra.properties.ui.tests;bundle-version="1.2.1", - org.eclipse.papyrus.uml.internationalization.tests;bundle-version="1.0.0", - org.eclipse.papyrus.uml.internationalization.controlmode.tests;bundle-version="1.0.0" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.100.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.tests.Activator -Bundle-SymbolicName: org.eclipse.papyrus.tests -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests - Failures.launch b/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests - Failures.launch deleted file mode 100644 index 4be2d26a2b4..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests - Failures.launch +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests With Coverage.launch b/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests With Coverage.launch deleted file mode 100644 index c7141af8016..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests With Coverage.launch +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests.launch b/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests.launch deleted file mode 100644 index 003a1121a7d..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests.launch +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus All Headless tests.launch b/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus All Headless tests.launch deleted file mode 100644 index f8523c0fb7a..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus All Headless tests.launch +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus All UI tests.launch b/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus All UI tests.launch deleted file mode 100644 index 961de8ec740..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus All UI tests.launch +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus Core tests (no SysML).launch b/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus Core tests (no SysML).launch deleted file mode 100644 index 037287cb364..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus Core tests (no SysML).launch +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus Generated Diagram Tests.launch b/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus Generated Diagram Tests.launch deleted file mode 100644 index da71e977a5b..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus Generated Diagram Tests.launch +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus SysML tests With Coverage.launch b/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus SysML tests With Coverage.launch deleted file mode 100644 index ff63daad3d6..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus SysML tests With Coverage.launch +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus SysML tests.launch b/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus SysML tests.launch deleted file mode 100644 index b7cf559b075..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus SysML tests.launch +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/about.html b/tests/junit/plugins/core/org.eclipse.papyrus.tests/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/tests/junit/plugins/core/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/core/org.eclipse.papyrus.tests/build.properties b/tests/junit/plugins/core/org.eclipse.papyrus.tests/build.properties deleted file mode 100644 index 2b4b9065052..00000000000 --- a/tests/junit/plugins/core/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/core/org.eclipse.papyrus.tests/plugin.properties b/tests/junit/plugins/core/org.eclipse.papyrus.tests/plugin.properties deleted file mode 100644 index 10f46ee5911..00000000000 --- a/tests/junit/plugins/core/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/core/org.eclipse.papyrus.tests/pom.xml b/tests/junit/plugins/core/org.eclipse.papyrus.tests/pom.xml deleted file mode 100644 index 85e599fe707..00000000000 --- a/tests/junit/plugins/core/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 - org.eclipse.papyrus.tests - 1.2.100-SNAPSHOT - eclipse-test-plugin - - - - org.eclipse.tycho - tycho-surefire-plugin - ${tycho-version} - - true - true - true - org.eclipse.sdk.ide - - ${skipAllTests} - 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/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/Activator.java b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/Activator.java deleted file mode 100644 index 7e5f01a0692..00000000000 --- a/tests/junit/plugins/core/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/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllGenTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllGenTests.java deleted file mode 100644 index 03199776f3c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllGenTests.java +++ /dev/null @@ -1,95 +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: - * Juan Cadavid - juan.cadavid@cea.fr - * Christian W. Damus - bug 464647 - * - *****************************************************************************/ -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.FragmentTestSuiteClass; -import org.eclipse.papyrus.junit.framework.runner.ITestSuiteClass; -import org.eclipse.papyrus.junit.framework.runner.SuiteSpot; -import org.junit.runner.RunWith; - -import com.google.common.collect.ImmutableList; - - -/** - * Tests generated with the Papyrus Test Generation Framework - */ -@RunWith(AllTestsRunner.class) -public class AllGenTests { - - @SuiteSpot - public static final List suiteClasses; - - /** list of classes to launch */ - static { - suiteClasses = new ArrayList(); - - /* **************** Dynamically loaded from the host plug-ins *********************** */ - - suiteClasses.add(new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.activity.tests", "org.eclipse.papyrus.uml.diagram.activity.test.AllGenTests")); - suiteClasses.add(new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.clazz.tests", "org.eclipse.papyrus.uml.diagram.clazz.test.AllGenTests")); - suiteClasses.add(new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.communication.tests", "org.eclipse.papyrus.uml.diagram.communication.test.AllGenTests")); - suiteClasses.add(new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.component.tests", "org.eclipse.papyrus.uml.diagram.component.test.AllGenTests")); - suiteClasses.add(new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.composite.tests", "org.eclipse.papyrus.uml.diagram.composite.test.AllGenTests")); - suiteClasses.add(new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.deployment.tests", "org.eclipse.papyrus.uml.diagram.deployment.test.AllGenTests")); - suiteClasses.add(new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.profile.tests", "org.eclipse.papyrus.uml.diagram.profile.tests.AllGenTests")); - suiteClasses.add(new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.statemachine.tests", "org.eclipse.papyrus.uml.diagram.statemachine.test.AllGenTests")); - suiteClasses.add(new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.sequence.tests", "org.eclipse.papyrus.uml.diagram.sequence.test.AllGenTests")); - suiteClasses.add(new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.timing.tests", "org.eclipse.papyrus.uml.diagram.timing.test.AllGenTests")); - suiteClasses.add(new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.usecase.tests", "org.eclipse.papyrus.uml.diagram.usecase.test.AllGenTests")); - // end - } - - // - // The tests broken out into sub-suites for serial execution, to avoid OOMEs - // - - @RunWith(AllTestsRunner.class) - public static class Suite1 { - @SuiteSpot - public static final List suiteClasses = ImmutableList.of( // - new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.clazz.tests", "org.eclipse.papyrus.uml.diagram.clazz.test.AllGenTests"), - new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.profile.tests", "org.eclipse.papyrus.uml.diagram.profile.tests.AllGenTests"), - new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.usecase.tests", "org.eclipse.papyrus.uml.diagram.usecase.test.AllGenTests")); - } - - @RunWith(AllTestsRunner.class) - public static class Suite2 { - @SuiteSpot - public static final List suiteClasses = ImmutableList.of( // - new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.component.tests", "org.eclipse.papyrus.uml.diagram.component.test.AllGenTests"), - new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.composite.tests", "org.eclipse.papyrus.uml.diagram.composite.test.AllGenTests"), - new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.deployment.tests", "org.eclipse.papyrus.uml.diagram.deployment.test.AllGenTests")); - } - - @RunWith(AllTestsRunner.class) - public static class Suite3 { - @SuiteSpot - public static final List suiteClasses = ImmutableList.of( // - new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.activity.tests", "org.eclipse.papyrus.uml.diagram.activity.test.AllGenTests"), - new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.statemachine.tests", "org.eclipse.papyrus.uml.diagram.statemachine.test.AllGenTests")); - } - - @RunWith(AllTestsRunner.class) - public static class Suite4 { - @SuiteSpot - public static final List suiteClasses = ImmutableList.of( // - new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.communication.tests", "org.eclipse.papyrus.uml.diagram.communication.test.AllGenTests"), - new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.sequence.tests", "org.eclipse.papyrus.uml.diagram.sequence.test.AllGenTests"), - new FragmentTestSuiteClass("org.eclipse.papyrus.uml.diagram.timing.tests", "org.eclipse.papyrus.uml.diagram.timing.test.AllGenTests")); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllHeadlessTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllHeadlessTests.java deleted file mode 100644 index 22fb7e6ae1f..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllHeadlessTests.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.tests; - -import java.util.List; -import java.util.stream.Collectors; - -import org.eclipse.papyrus.junit.framework.runner.AllTestsRunner; -import org.eclipse.papyrus.junit.framework.runner.Headless; -import org.eclipse.papyrus.junit.framework.runner.ITestSuiteClass; -import org.eclipse.papyrus.junit.framework.runner.SuiteSpot; -import org.junit.runner.RunWith; - -/** - * A test suite that automatically selects all {@linkplain Headless headless tests} - * from the {@link AllTests} suite. - */ -@RunWith(AllTestsRunner.class) -public class AllHeadlessTests { - - @SuiteSpot - public static final List suiteClasses; - - static { - suiteClasses = AllTests.suiteClasses.stream() - .filter(ITestSuiteClass::isHeadless) - .collect(Collectors.toList()); - } - - public AllHeadlessTests() { - super(); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java deleted file mode 100644 index 46039d91691..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java +++ /dev/null @@ -1,162 +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<>(); - - /* **************** plugins *********************** */ - /* developper */ - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.bundles.tests.AllTests.class)); - - /* core */ - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.core.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.core.clipboard.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.core.sasheditor.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.core.sasheditor.di.tests.AllTests.class)); - - /* infra */ - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.tools.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.ui.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.edit.tests.suites.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.edit.ui.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.labelprovider.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.semantic.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.emf.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.emf.gmf.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.ui.emf.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.types.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.types.ui.tests.AllTests.class)); - // suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.openelement.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.commands.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.common.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.canonical.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.emf.readonly.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.viewpoints.configuration.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.editor.welcome.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.welcome.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.properties.ui.tests.AllTests.class)); - - /* customization */ - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.eclipse.project.editors.tests.AllTests.class)); - - /* views */ - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.views.modelexplorer.tests.AllTests.class)); - - /* integration */ - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.editor.integration.tests.AllTests.class)); - - // FIXME: Workaround for Bug 441246: Move the ResourceLoading tests after EditorReloadTest, since they are currently conflicting - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.resourceloading.tests.AllTests.class)); - - /* search */ - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.search.tests.suites.AllTests.class)); - - /* css */ - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.css.tests.tests.AllTests.class)); - - /* menu */ - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.menu.tests.tests.AllTests.class)); - - /* control mode */ - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.controlmode.tests.AllTests.class)); - - /* Diagram Assistants test suite */ - org.eclipse.papyrus.tests.diagramassistants.AllTests.appendTo(suiteClasses); - - /* Profile Drafter */ - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.profile.drafter.tests.AllTests.class)); - - /* uml */ - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.service.types.tests.suites.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.service.types.ui.tests.suites.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.modelexplorer.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.dnd.tests.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.tools.tests.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.tools.utils.tests.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.stereotypeproperty.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.wizards.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.modelrepair.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.profile.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.decoratormodel.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.decoratormodel.controlmode.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.validation.tests.AllTests.class)); - - /* uml diagrams */ - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.common.tests.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.clazz.test.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.activity.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.deployment.test.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.component.test.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.timing.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.usecase.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.composite.test.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.statemachine.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.communication.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.profile.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.sequence.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.interactionoverview.tests.AllTests.class)); - // - - // nattable tests - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.nattable.views.tests.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.nattable.common.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.nattable.model.editor.tests.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.nattable.model.tests.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.nattable.tests.tests.AllTests.class)); - - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.nattable.tests.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.nattable.generic.tests.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.nattable.clazz.config.tests.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.nattable.stereotype.display.tests.tests.AllTests.class)); - - // uml textedit tests - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.textedit.port.tests.suites.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.textedit.property.tests.suites.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.textedit.parameter.tests.suites.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.textedit.valuespecification.tests.suites.AllTests.class)); - - // Alf - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.alf.tests.AllTests.class)); - - // Internationalization - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.internationalization.tests.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.internationalization.tests.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.internationalization.controlmode.tests.tests.AllTests.class)); - - // end - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllUITests.java b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllUITests.java deleted file mode 100644 index ed028a380e5..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllUITests.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.tests; - -import java.util.List; -import java.util.stream.Collectors; - -import org.eclipse.papyrus.junit.framework.runner.AllTestsRunner; -import org.eclipse.papyrus.junit.framework.runner.Headless; -import org.eclipse.papyrus.junit.framework.runner.ITestSuiteClass; -import org.eclipse.papyrus.junit.framework.runner.SuiteSpot; -import org.junit.runner.RunWith; - -/** - * A test suite that automatically selects all non-{@linkplain Headless headless} tests - * from the {@link AllTests} suite. - */ -@RunWith(AllTestsRunner.class) -public class AllUITests { - - @SuiteSpot - public static final List suiteClasses; - - static { - suiteClasses = AllTests.suiteClasses.stream() - .filter(ITestSuiteClass::isUI) - .collect(Collectors.toList()); - } - - public AllUITests() { - super(); - } - -} diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/pom.xml b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/pom.xml index ea4673403dd..9fbbd9b4971 100644 --- a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/pom.xml +++ b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/pom.xml @@ -8,7 +8,7 @@ 3.0.0-SNAPSHOT ../../../../../releng/dev - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.bundles.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/.classpath b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/.classpath new file mode 100755 index 00000000000..83be1d9f78c --- /dev/null +++ b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/.project b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/.project new file mode 100755 index 00000000000..ad10bda06c6 --- /dev/null +++ b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.developer.suite.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/developer/org.eclipse.papyrus.developer.suite.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/.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/plugins/developer/org.eclipse.papyrus.developer.suite.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100755 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/.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/plugins/developer/org.eclipse.papyrus.developer.suite.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/META-INF/MANIFEST.MF new file mode 100755 index 00000000000..684ae63ac2b --- /dev/null +++ b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/META-INF/MANIFEST.MF @@ -0,0 +1,17 @@ +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 0.0.1.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.developer.suite.tests.Activator +Bundle-SymbolicName: org.eclipse.papyrus.developer.suite.tests +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", + org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", + org.eclipse.papyrus.bundles.tests;bundle-version="1.2.0" + diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/Papyrus Developer ALL tests.launch b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/Papyrus Developer ALL tests.launch new file mode 100755 index 00000000000..93ff3712582 --- /dev/null +++ b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/Papyrus Developer ALL tests.launch @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/about.html b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/about.html new file mode 100755 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/about.html @@ -0,0 +1,28 @@ + + + + +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/developer/org.eclipse.papyrus.developer.suite.tests/build.properties b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/build.properties new file mode 100755 index 00000000000..9a313f187de --- /dev/null +++ b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/build.properties @@ -0,0 +1,7 @@ +source.. = test/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + about.html,\ + Papyrus Developer ALL tests.launch diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/plugin.properties b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/plugin.properties new file mode 100755 index 00000000000..5375243083c --- /dev/null +++ b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/plugin.properties @@ -0,0 +1,12 @@ +################################################################################# +# 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=Developer tests for Papyrus +providerName=Eclipse Modeling Project diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/pom.xml b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/pom.xml new file mode 100755 index 00000000000..f826205f6fe --- /dev/null +++ b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/pom.xml @@ -0,0 +1,55 @@ + + + 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.developer.suite.tests + 0.0.1-SNAPSHOT + eclipse-test-plugin + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + true + true + true + org.eclipse.sdk.ide + + ${skipAllTests} + org.eclipse.papyrus.developer.suite.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 + + + + + + + + diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/test/org/eclipse/papyrus/developer/suite/tests/Activator.java b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/test/org/eclipse/papyrus/developer/suite/tests/Activator.java new file mode 100755 index 00000000000..c6126df82bc --- /dev/null +++ b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/test/org/eclipse/papyrus/developer/suite/tests/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.developer.suite.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.developer.suite.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) + */ + @Override + 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) + */ + @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; + } + +} diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/test/org/eclipse/papyrus/developer/suite/tests/AllTests.java b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/test/org/eclipse/papyrus/developer/suite/tests/AllTests.java new file mode 100755 index 00000000000..683a98ac26d --- /dev/null +++ b/tests/junit/plugins/developer/org.eclipse.papyrus.developer.suite.tests/test/org/eclipse/papyrus/developer/suite/tests/AllTests.java @@ -0,0 +1,47 @@ +/***************************************************************************** + * 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.developer.suite.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<>(); + + /* **************** plugins *********************** */ + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.bundles.tests.AllTests.class)); + + + // end + } + +} diff --git a/tests/junit/plugins/developer/pom.xml b/tests/junit/plugins/developer/pom.xml new file mode 100755 index 00000000000..9380df3f9de --- /dev/null +++ b/tests/junit/plugins/developer/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.plugins.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.developer.tests.releng + 0.0.1-SNAPSHOT + pom + Developer tests for Papyrus + + + + org.eclipse.papyrus.developer.suite.tests + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.eclipse.project.editors.tests/pom.xml b/tests/junit/plugins/editor/org.eclipse.papyrus.eclipse.project.editors.tests/pom.xml index 1adc7c826d0..d8ea91e7494 100644 --- a/tests/junit/plugins/editor/org.eclipse.papyrus.eclipse.project.editors.tests/pom.xml +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.eclipse.project.editors.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.eclipse.project.editors.tests 2.0.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/.classpath b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/.classpath new file mode 100644 index 00000000000..64c5e31b7a2 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/.project b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/.project new file mode 100644 index 00000000000..b462121a6c6 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.editor.integration.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/editor/org.eclipse.papyrus.editor.integration.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c585cc455ae --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/.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.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 +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/editor/org.eclipse.papyrus.editor.integration.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/.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/plugins/editor/org.eclipse.papyrus.editor.integration.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..b5cfb384cf8 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/META-INF/MANIFEST.MF @@ -0,0 +1,47 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.papyrus.infra.core;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.clazz;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.timing;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="[3.0.0,4.0.0)", + org.eclipse.gmf.runtime.notation;bundle-version="1.5.0", + org.eclipse.papyrus.uml.tools;bundle-version="1.2.0", + org.eclipse.uml2.uml;bundle-version="4.1.0", + org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.2.0", + org.eclipse.ui.ide;bundle-version="3.9.0", + org.eclipse.emf.transaction;bundle-version="1.4.0", + org.eclipse.gmf.runtime.common.core;bundle-version="1.7.0", + org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.7.0", + org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0", + org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.7.0", + org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="1.7.0", + org.eclipse.papyrus.infra.services.edit;bundle-version="1.2.0", + org.junit;bundle-version="4.10.0", + org.eclipse.papyrus.views.modelexplorer;bundle-version="1.2.0", + org.eclipse.ui.navigator;bundle-version="3.5.0", + org.eclipse.papyrus.infra.services.validation;bundle-version="1.2.0", + org.eclipse.papyrus.uml.service.validation;bundle-version="1.2.0", + com.google.guava;bundle-version="11.0.0", + org.eclipse.papyrus.infra.nattable.common;bundle-version="1.2.0", + org.eclipse.papyrus.infra.nattable;bundle-version="1.2.0", + org.eclipse.papyrus.uml.nattable.menu;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.sequence;bundle-version="1.2.0", + org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", + org.eclipse.papyrus.junit.framework;bundle-version="1.2.0", + org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", + org.eclipse.papyrus.infra.ui;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="1.2.0" +Export-Package: org.eclipse.papyrus.editor.integration.tests, + org.eclipse.papyrus.editor.integration.tests.tests +Bundle-Vendor: Eclipse Modeling Project +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Name: Papyrus Editor Integration Tests +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.editor.integration.tests.Activator +Bundle-SymbolicName: org.eclipse.papyrus.editor.integration.tests +Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/about.html b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/about.html new file mode 100644 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/about.html @@ -0,0 +1,28 @@ + + + + +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/editor/org.eclipse.papyrus.editor.integration.tests/build.properties b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/build.properties new file mode 100644 index 00000000000..6b8634c222f --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + model/ +src.includes = about.html diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.di new file mode 100644 index 00000000000..8148e9633e1 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.di @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.notation new file mode 100644 index 00000000000..226c64a89fd --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.notation @@ -0,0 +1,578 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + +
+
+ + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.uml new file mode 100644 index 00000000000..951eaa9cc2c --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/complex_multipage_model.uml @@ -0,0 +1,178 @@ + + + + Complex model with many pages and a specific layout + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + State 1 + + + + + + + + +
+ + + + State 2 + + + + + + + + +
+ + + + State 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + State 1 + + + + + + + + +
+ + + + State 3 + + + + + + + + +
+ + + + State 2 + + + + + + + + +
+ + + + State 1 + + + + + + + + +
+ + + + State 3 + + + + + +
+ + +
+
+ + + + +
+ + + + +
+ + +
+
+
+ + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.di new file mode 100644 index 00000000000..8ae13a19f1e --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.di @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.notation new file mode 100644 index 00000000000..660b276d194 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.notation @@ -0,0 +1,282 @@ + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.uml new file mode 100644 index 00000000000..41d2a331cba --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_diagram.uml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.di new file mode 100644 index 00000000000..2c53cfcf529 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.di @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.notation new file mode 100644 index 00000000000..8e19ab5e0ce --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.notation @@ -0,0 +1,666 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.uml new file mode 100644 index 00000000000..ca30b5e89de --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_contained_table.uml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.di new file mode 100644 index 00000000000..ec515781fcd --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.di @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.notation new file mode 100644 index 00000000000..f69e268e509 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.notation @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.uml new file mode 100644 index 00000000000..7aa02902acd --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/delete_sash_page.uml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.di new file mode 100644 index 00000000000..9bddb6f752a --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.di @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.notation new file mode 100644 index 00000000000..bf9abab340f --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.notation @@ -0,0 +1,2 @@ + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.uml new file mode 100644 index 00000000000..9cda1ff90d3 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/empty_model.uml @@ -0,0 +1,2 @@ + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.di new file mode 100644 index 00000000000..a0c464641d4 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.di @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.notation new file mode 100644 index 00000000000..e6d14315d3f --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.notation @@ -0,0 +1,93 @@ + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.uml new file mode 100644 index 00000000000..dd30e382016 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_class_model.uml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.di new file mode 100644 index 00000000000..f984b86c331 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.di @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.notation new file mode 100644 index 00000000000..bf9abab340f --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.notation @@ -0,0 +1,2 @@ + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.uml new file mode 100644 index 00000000000..89a192bff5a --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_table_model.uml @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.di new file mode 100644 index 00000000000..4ce4e686639 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.di @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.notation new file mode 100644 index 00000000000..f9ff8f7b201 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.notation @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.uml new file mode 100644 index 00000000000..195a0e80b5f --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/simple_uml_generic_table_model.uml @@ -0,0 +1,2 @@ + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/table.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/table.di new file mode 100644 index 00000000000..0eab39cbb9c --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/table.di @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/table.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/table.notation new file mode 100644 index 00000000000..8ce107d34ff --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/table.notation @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/table.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/table.uml new file mode 100644 index 00000000000..715500c8abc --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/table.uml @@ -0,0 +1,4 @@ + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.di new file mode 100644 index 00000000000..cf4c7e491ce --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.di @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.notation new file mode 100644 index 00000000000..447b1891da3 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.notation @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.uml new file mode 100644 index 00000000000..7b08dbe5e96 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_diagrams_model.uml @@ -0,0 +1,12 @@ + + + + This model contains two diagrams. The Class Diagram is opened, while the timing diagram is closed. + +Expected behavior: + + - allPages() contains two entries + - activeEditor is a UML Class Diagram Editor + - activePage() is a Class Diagram + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.di new file mode 100644 index 00000000000..47afbb32acf --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.di @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.notation new file mode 100644 index 00000000000..044d61cfeaf --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.notation @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.uml new file mode 100644 index 00000000000..182886efd40 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/two_tables_model.uml @@ -0,0 +1,13 @@ + + + + This model contains two tables. The Generic Table is opened, while the table of views is closed. +Expected behavior: +- allPages() contains two entries +- activeEditor is a UML Generic Table Editor Editor +- activePage() is a Generic Table + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.di new file mode 100644 index 00000000000..6973c8a48a6 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.di @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.notation new file mode 100644 index 00000000000..d8bec030baf --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.notation @@ -0,0 +1,93 @@ + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.uml new file mode 100644 index 00000000000..cac8a57cf98 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/basic/unnamed_diagram.uml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.di new file mode 100644 index 00000000000..bf9abab340f --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.di @@ -0,0 +1,2 @@ + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.notation new file mode 100644 index 00000000000..50f74c0a930 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.notation @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.uml new file mode 100644 index 00000000000..c4c95eda8ff --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.uml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.di new file mode 100644 index 00000000000..641e1446fd0 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.di @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.notation new file mode 100644 index 00000000000..dba85c8bdfd --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.notation @@ -0,0 +1,107 @@ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.uml new file mode 100644 index 00000000000..10080eb029d --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/model set/^&_&^.uml @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee-no-constraints.profile.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee-no-constraints.profile.uml new file mode 100644 index 00000000000..ba4a69ee274 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee-no-constraints.profile.uml @@ -0,0 +1,252 @@ + + + + + +
+ + +
+
+
+
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OCL + base_Property + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OCL + Set{base_Class, base_Interface}->excludingNull()->any(true) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee.profile.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee.profile.uml new file mode 100644 index 00000000000..2ecfb621eb5 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/j2ee.profile.uml @@ -0,0 +1,317 @@ + + + + + +
+
+ + +
+
+
+
+
+ + + + + +
+ + + + + + + + + + + + + + +
+ + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OCL + base_Property + + + + + + + + + + + + + + + + + + + + + + + + OCL + getBaseElement().name <> null + + + + + + + + + + + + + + + + + + + + + + + OCL + true + + + + + + + + + + + + + + + + + + OCL + Set{base_Class, base_Interface}->excludingNull()->any(true) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.di new file mode 100644 index 00000000000..571f53ee13f --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.di @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.notation new file mode 100644 index 00000000000..d98e9c7cb2f --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.notation @@ -0,0 +1,71 @@ + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.uml new file mode 100644 index 00000000000..9891f8006a8 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model-no-j2ee-constraints.uml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + gold + p1 + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model.di new file mode 100644 index 00000000000..3f8c9b9d256 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model.di @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model.notation new file mode 100644 index 00000000000..9482a3e63b3 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model.notation @@ -0,0 +1,71 @@ + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model.uml new file mode 100644 index 00000000000..42136560022 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/profile/model.uml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + gold + p1 + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.di new file mode 100644 index 00000000000..5930bed8a28 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.di @@ -0,0 +1,407 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.notation new file mode 100644 index 00000000000..f5507da16d2 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.notation @@ -0,0 +1,560 @@ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.uml new file mode 100644 index 00000000000..1ce9f208bec --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/complex_invalid_model.uml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + +
+ + + + State 1 + + + + + + + + +
+ + + + State 2 + + + + + + + + +
+ + + + State 1 + + + + + + + + +
+ + + + State 2 + + + + + +
+ + + + State 1 + + + + + + + + +
+ + + + State 1 + + + + + + + + +
+ + + + State 1 + + + + + + + + +
+ + + + State 1 + + + + + +
+ + +
+
+ + + + +
+ + +
+ + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.di new file mode 100644 index 00000000000..999777efdca --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.di @@ -0,0 +1,3 @@ + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.notation new file mode 100644 index 00000000000..09226e54cff --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.notation @@ -0,0 +1,92 @@ + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.uml new file mode 100644 index 00000000000..af3a8b2813a --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/empty_di_model.uml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.di new file mode 100644 index 00000000000..0a036f53b02 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.di @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.notation new file mode 100644 index 00000000000..8c5a0aa6b53 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.notation @@ -0,0 +1,131 @@ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.uml new file mode 100644 index 00000000000..2de07cebb9e --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalidAvailablePage.uml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.di new file mode 100644 index 00000000000..9d0978390cd --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.di @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.notation new file mode 100644 index 00000000000..7f116ca591e --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.notation @@ -0,0 +1,5 @@ + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.uml new file mode 100644 index 00000000000..87ae8a924d3 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/invalid_child_tab.uml @@ -0,0 +1,2 @@ + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.di new file mode 100644 index 00000000000..3083fd532f7 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.di @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.notation new file mode 100644 index 00000000000..79a8c707090 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.notation @@ -0,0 +1,92 @@ + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.uml new file mode 100644 index 00000000000..32914dd29ce --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/missing_page_recovery.uml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.di new file mode 100644 index 00000000000..915cb124ff0 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.di @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.notation new file mode 100644 index 00000000000..5e48e04744d --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.notation @@ -0,0 +1,98 @@ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.uml new file mode 100644 index 00000000000..a479a3d973b --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_diagram_recovery.uml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.di new file mode 100644 index 00000000000..ef395d7bb10 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.di @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.notation new file mode 100644 index 00000000000..2170ffcb63d --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.notation @@ -0,0 +1,92 @@ + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.uml new file mode 100644 index 00000000000..f19c0930f1b --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/recovery/proxy_table_recovery.uml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.di new file mode 100644 index 00000000000..db3312a6d7a --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.di @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.notation new file mode 100644 index 00000000000..7a00061ce0e --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.notation @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.uml new file mode 100644 index 00000000000..aa426b736e7 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/banking.uml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.di new file mode 100644 index 00000000000..d94f1fa4ed4 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.di @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.notation new file mode 100644 index 00000000000..16e458be63e --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.notation @@ -0,0 +1,415 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.uml new file mode 100644 index 00000000000..4ff766e905a --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment.uml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.di new file mode 100644 index 00000000000..68491525f92 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.di @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.notation new file mode 100644 index 00000000000..a80718a7ca7 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.notation @@ -0,0 +1,415 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.uml new file mode 100644 index 00000000000..4ff766e905a --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/employment_sashes.uml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/library.di b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/library.di new file mode 100644 index 00000000000..42ec9bffb56 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/library.di @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/library.notation b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/library.notation new file mode 100644 index 00000000000..97b9536a1e0 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/library.notation @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/library.uml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/library.uml new file mode 100644 index 00000000000..06f7daf5a6a --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/model/reload/library.uml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/org.eclipse.papyrus.editor.integration.tests.launch b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/org.eclipse.papyrus.editor.integration.tests.launch new file mode 100644 index 00000000000..53fb6cee559 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/org.eclipse.papyrus.editor.integration.tests.launch @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/pom.xml b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/pom.xml new file mode 100644 index 00000000000..1b054c2571d --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + + org.eclipse.papyrus + org.eclipse.papyrus.tests.releng + 1.2.0-SNAPSHOT + ../../../../../releng/main-tests + + org.eclipse.papyrus.tests + org.eclipse.papyrus.editor.integration.tests + 1.2.0-SNAPSHOT + eclipse-test-plugin + diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/Activator.java b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/Activator.java new file mode 100644 index 00000000000..57072ae8043 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/Activator.java @@ -0,0 +1,76 @@ +/***************************************************************************** + * 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.editor.integration.tests; + +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.editor.integration.tests"; //$NON-NLS-1$ + + /** + * The shared instance + */ + private static Activator plugin; + + /** + * The Log helper for this plug-in + */ + public static LogHelper log; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + log = new LogHelper(this); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @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; + } + +} diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/AllTests.java b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/AllTests.java new file mode 100644 index 00000000000..b4021cf42be --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/AllTests.java @@ -0,0 +1,41 @@ +/***************************************************************************** + * 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 422257 + * Christian W. Damus (CEA) - bug 432813 + * Christian W. Damus (CEA) - bug 437217 + * + *****************************************************************************/ +package org.eclipse.papyrus.editor.integration.tests; + +import org.eclipse.papyrus.editor.integration.tests.tests.EditingScenariosMemoryLeakTest; +import org.eclipse.papyrus.editor.integration.tests.tests.EditorMemoryLeakTest; +import org.eclipse.papyrus.editor.integration.tests.tests.EditorReloadTest; +import org.eclipse.papyrus.editor.integration.tests.tests.ModelSetTests; +import org.eclipse.papyrus.editor.integration.tests.tests.PageManagerTests; +import org.eclipse.papyrus.editor.integration.tests.tests.RecoveryTest; +import org.junit.runner.RunWith; +import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; +import org.junit.runners.Suite.SuiteClasses; + + +/** + * The {@link EditorMemoryLeakTest} suite must run first, because some test case in one of the other suites + * breaks the Outline view: it causes a pair of Overview/Outline actions from some diagram editor to linger in + * the outline view's toolbar even after the editor was closed, and these persistent actions cause leaks of + * models opened later. + */ +@RunWith(ClassificationSuite.class) +@SuiteClasses({ EditorMemoryLeakTest.class, EditingScenariosMemoryLeakTest.class, // +PageManagerTests.class, RecoveryTest.class, ModelSetTests.class, // +EditorReloadTest.class }) +public class AllTests { + +} diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/AbstractEditorIntegrationTest.java b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/AbstractEditorIntegrationTest.java new file mode 100644 index 00000000000..52b05d47f0c --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/AbstractEditorIntegrationTest.java @@ -0,0 +1,26 @@ +/***************************************************************************** + * 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.editor.integration.tests.tests; + +import org.eclipse.papyrus.editor.integration.tests.Activator; +import org.eclipse.papyrus.junit.utils.tests.AbstractEditorTest; +import org.osgi.framework.Bundle; + + +public abstract class AbstractEditorIntegrationTest extends AbstractEditorTest { + + @Override + protected Bundle getBundle() { + return Activator.getDefault().getBundle(); + } + +} diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingMemoryLeakFixture.java b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingMemoryLeakFixture.java new file mode 100644 index 00000000000..a406ceb41ba --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingMemoryLeakFixture.java @@ -0,0 +1,197 @@ +/* + * 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 483721 + * + */ +package org.eclipse.papyrus.editor.integration.tests.tests; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.util.Collections; + +import org.eclipse.emf.common.command.CommandStack; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.commands.Command; +import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; +import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack; +import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; +import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramEditDomain; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper; +import org.eclipse.papyrus.infra.core.utils.AdapterUtils; +import org.eclipse.papyrus.junit.utils.Duck; +import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.part.ISetSelectionTarget; +import org.junit.Rule; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + + +/** + * A convenience fixture-rule for working with diagram editors in memory-leak test cases. It wraps a {@link PapyrusEditorFixture}, + * which must not be tagged a an {@link Rule @Rule} in its own right, because this fixture rule ensures that it decorates + * the test with the appropriate precedence. + */ +class EditingMemoryLeakFixture extends TestWatcher { + + static final String PROPERTY_SHEET = "org.eclipse.ui.views.PropertySheet"; + + static final String OUTLINE = "org.eclipse.ui.views.ContentOutline"; + + static final String PROJECT_EXPLORER = "org.eclipse.ui.navigator.ProjectExplorer"; + + static final String PACKAGE_EXPLORER = "org.eclipse.jdt.ui.PackageExplorer"; + + private final PapyrusEditorFixture editor; + + EditingMemoryLeakFixture(PapyrusEditorFixture editor) { + super(); + + this.editor = editor; + } + + public void selectModelInModelExplorer() { + // Select the Model element + editor.getModelExplorerView().revealSemanticElement(Collections.singletonList(editor.getModel())); + editor.flushDisplayEvents(); + } + + public void closeEditor() { + editor.close(); + + // now, open a new editor and close it to ensure that views such as Model Explorer, Outline, etc. get + // a new model into context and forget the previous + editor.open("model/basic/empty_model.di"); // This will be closed automatically when finished + selectModelInModelExplorer(); + + editor.getView(PROPERTY_SHEET, true); + editor.getView(OUTLINE, true); + + // Select something in the Project Explorer to flush the last model selection from the Properties view's default page + selectProjectInProjectExplorer(); + + editor.getView(PROPERTY_SHEET, true); + editor.getView(OUTLINE, true); + + editor.activate(); + } + + public IEditorPart getActiveEditor() { + return editor.getEditor().getActiveEditor(); + } + + public DiagramEditor getDiagramEditor() { + return AdapterUtils.adapt(getActiveEditor(), DiagramEditor.class, null); + } + + public DiagramEditPart getDiagramEditPart() { + return AdapterUtils.adapt(getDiagramEditor(), DiagramEditPart.class, null); + } + + public IDiagramEditDomain getEditDomain() { + return getDiagramEditor().getDiagramEditDomain(); + } + + public TransactionalEditingDomain getEditingDomain() { + TransactionalEditingDomain result = null; + + // Is the active inner editor a diagram editor? + DiagramEditor diagram = getDiagramEditor(); + if (diagram != null) { + result = diagram.getEditingDomain(); + } + + if (result == null) { + // Maybe it's a table editor + IEditorPart active = getActiveEditor(); + if (active != null) { + result = new Duck(active).quackp("get.+", TransactionalEditingDomain.class); + } + } + + if (result == null) { + // Fall back to the outer editor + result = editor.getEditingDomain(); + } + + return result; + } + + public CommandStack getCommandStack() { + return getEditingDomain().getCommandStack(); + } + + public DiagramCommandStack getDiagramCommandStack() { + return getEditDomain().getDiagramCommandStack(); + } + + public void execute(Command command) { + execute(GEFtoEMFCommandWrapper.wrap(command)); + } + + public void execute(org.eclipse.emf.common.command.Command command) { + final CommandStack stack = getCommandStack(); + + stack.execute(command); + + editor.flushDisplayEvents(); + + assertThat("Command execution failed. Checked the workspace log for details.", stack.getUndoCommand(), is(command)); + } + + public void selectProjectInProjectExplorer() { + ISetSelectionTarget projectExplorer = getProjectOrPackageExplorer(); + projectExplorer.selectReveal(new StructuredSelection(editor.getProject().getProject())); + editor.flushDisplayEvents(); + } + + ISetSelectionTarget getProjectOrPackageExplorer() { + ISetSelectionTarget result = null; + + IViewPart explorer = editor.getView(PROJECT_EXPLORER, false); + if (explorer == null) { + // Maybe we're in the Java perspective + explorer = editor.getView(PACKAGE_EXPLORER, false); + if (explorer == null) { + // Force the Project Explorer, then + explorer = editor.getView(PROJECT_EXPLORER, true); + } + } + + result = (ISetSelectionTarget) explorer; + + return result; + } + + // + // Test lifecycle + // + + @Override + public Statement apply(Statement base, Description description) { + return editor.apply(super.apply(base, description), description); + } + + @Override + protected void starting(Description description) { + editor.ensurePapyrusPerspective(); + selectModelInModelExplorer(); + } + + @Override + protected void finished(Description description) { + closeEditor(); + } +} diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingScenariosMemoryLeakTest.java b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingScenariosMemoryLeakTest.java new file mode 100644 index 00000000000..651e20ec554 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingScenariosMemoryLeakTest.java @@ -0,0 +1,162 @@ +/* + * 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 433206 + * + */ +package org.eclipse.papyrus.editor.integration.tests.tests; + +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.MatcherAssert.assertThat; + +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.gef.commands.Command; +import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest; +import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory; +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; +import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper; +import org.eclipse.papyrus.infra.nattable.common.editor.NatTableEditor; +import org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager; +import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager; +import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; +import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; +import org.eclipse.papyrus.junit.framework.classification.rules.MemoryLeakRule; +import org.eclipse.papyrus.junit.framework.classification.rules.MemoryLeakRule.SoftReferenceSensitive; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram; +import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture; +import org.eclipse.papyrus.junit.utils.rules.PluginResource; +import org.eclipse.papyrus.uml.diagram.clazz.providers.UMLElementTypes; +import org.eclipse.papyrus.uml.nattable.menu.util.TableMenuUtils; +import org.eclipse.ui.IEditorPart; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Enumeration; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.UMLPackage; +import org.junit.Rule; +import org.junit.Test; + + +/** + * Test cases checking slightly more complex editing scenarios for leaks of user models. + */ +@PluginResource("model/basic/simple_class_model.di") +public class EditingScenariosMemoryLeakTest extends AbstractPapyrusTest { + + @Rule + public final MemoryLeakRule memory = new MemoryLeakRule(); + + private final PapyrusEditorFixture editor = new PapyrusEditorFixture(); + + @Rule + public final EditingMemoryLeakFixture fixture = new EditingMemoryLeakFixture(editor); + + public EditingScenariosMemoryLeakTest() { + super(); + } + + /** + * Verify that models do not leak when closing the editor after creating a new element. + */ + @Test + @SoftReferenceSensitive + public void testCreateNewElement() { + memory.add(editor.getModel()); + + CreateViewRequest requestcreation = CreateViewRequestFactory.getCreateShapeRequest(UMLElementTypes.Class_Shape, fixture.getDiagramEditPart().getDiagramPreferencesHint()); + Command command = fixture.getDiagramEditPart().getCommand(requestcreation); + fixture.execute(command); + } + + /** + * Verify that models do not leak when closing the editor after creating a new element in a table. + */ + @Test + @SoftReferenceSensitive + @PluginResource("model/basic/table.di") + public void testCreateNewElement_table() { + memory.add(editor.getModel()); + + // The TableMenuUtils needs the table-editor to be active + editor.activate(); + + IEditorPart tableEditor = fixture.getActiveEditor(); + assertThat("Not a table editor", tableEditor, instanceOf(NatTableEditor.class)); + INattableModelManager manager = (INattableModelManager) tableEditor.getAdapter(INattableModelManager.class); + assertThat(manager, notNullValue()); + IAxisManager axisManager = manager.getRowAxisManager(); + final int originalAxisSize = axisManager.getAllManagedAxis().size(); + + fixture.execute(getCreateClassInTableCommand()); + + // Verify that the element was added + int newAxisSize = axisManager.getAllManagedAxis().size(); + assertThat("Class not added to table", newAxisSize > originalAxisSize); + + // Close the editor and open it again, to force actions etc. to forget the previous selection + editor.close(); + editor.open(); + fixture.selectModelInModelExplorer(); + + // Do another edit ... + try { + fixture.execute(getCreateClassInTableCommand()); + } catch (AssertionError failure) { + // Doesn't matter to our purposes + } + } + + /** + * Verify that diagrams having active canonical edit policies do not cause leaks. + */ + @Test + @SoftReferenceSensitive + @PluginResource("model/canonical/css_leaktest.di") + @ActiveDiagram("main") + public void testCanonicalEditPolicy_bug433206() { + memory.add(editor.getModel()); + memory.add(editor.getActiveDiagramEditor().getDiagram()); + + // Cause some views to be created canonically + editor.getEditingDomain().getCommandStack().execute(new RecordingCommand(editor.getEditingDomain()) { + + @Override + protected void doExecute() { + final Package model = editor.getModel(); + + final Class class1 = (Class) model.getOwnedType("Class1"); + class1.createOwnedAttribute("name", null); + class1.createOwnedOperation("doIt", null, null); + class1.createNestedClassifier("nested", UMLPackage.Literals.PRIMITIVE_TYPE); + + final Enumeration enum1 = (Enumeration) model.getOwnedType("Enumeration1"); + enum1.createOwnedLiteral("one"); + enum1.createOwnedLiteral("two"); + + final Package package1 = model.getNestedPackage("Package1"); + package1.createOwnedClass("Foo", false); + } + }); + editor.flushDisplayEvents(); + + } + + // + // Test framework + // + + org.eclipse.emf.common.command.Command getCreateClassInTableCommand() { + CreateElementRequest request = new CreateElementRequest(fixture.getEditingDomain(), editor.getModel(), UMLElementTypes.Class_Shape); + IElementEditService edit = ElementEditServiceUtils.getCommandProvider(editor.getModel()); + org.eclipse.emf.common.command.Command create = GMFtoEMFCommandWrapper.wrap(edit.getEditCommand(request)); + return TableMenuUtils.buildNattableCreationCommand(create, request); + } +} diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorMemoryLeakTest.java b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorMemoryLeakTest.java new file mode 100644 index 00000000000..899a2bf8cf6 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorMemoryLeakTest.java @@ -0,0 +1,202 @@ +/* + * 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 485214, 474467 + * + */ +package org.eclipse.papyrus.editor.integration.tests.tests; + +import static org.eclipse.papyrus.editor.integration.tests.tests.EditingMemoryLeakFixture.PROPERTY_SHEET; +import static org.junit.Assert.fail; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.emf.ecore.EGenericType; +import org.eclipse.emf.ecore.ETypedElement; +import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; +import org.eclipse.papyrus.infra.services.validation.commands.ValidateModelCommand; +import org.eclipse.papyrus.junit.framework.classification.rules.MemoryLeakRule; +import org.eclipse.papyrus.junit.framework.classification.rules.MemoryLeakRule.SoftReferenceSensitive; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture; +import org.eclipse.papyrus.junit.utils.rules.PluginResource; +import org.junit.Rule; +import org.junit.Test; + + +/** + * Test cases checking that various different scenarios in the Papyrus Editor don't lead to memory leaks after the editor has been closed. + */ +@PluginResource("model/basic/simple_class_model.di") +public class EditorMemoryLeakTest extends AbstractPapyrusTest { + + @Rule + public final MemoryLeakRule memory = new MemoryLeakRule(); + + private final PapyrusEditorFixture editor = new PapyrusEditorFixture(); + + @Rule + public final EditingMemoryLeakFixture fixture = new EditingMemoryLeakFixture(editor); + + public EditorMemoryLeakTest() { + super(); + } + + /** + * Verify that the Model Set does not leak when closing the editor. + */ + @Test + public void testModelSetDoesNotLeak() { + memory.add(editor.getModelSet()); + } + + /** + * Verify that the UML Model content in the Model Explorer does not leak when closing the editor. + */ + @Test + @SoftReferenceSensitive + public void testModelExplorerContentDoesNotLeak() { + memory.add(editor.getModel()); + } + + /** + * Verify that diagram view parts do not leak when closing the editor. + */ + @Test + @SoftReferenceSensitive + public void testDiagramContentDoesNotLeak() { + DiagramEditor diagramEditor = (DiagramEditor) editor.getEditor().getActiveEditor(); + memory.add(diagramEditor.getDiagramEditPart()); + } + + /** + * Verify that the property sheet does not leak models when closing the editor. + */ + @Test + @SoftReferenceSensitive + public void testPropertySheetContentDoesNotLeak() { + // Activate the Properties view + editor.getView(PROPERTY_SHEET, true); + + // Select the Model element to show it in the Properties + fixture.selectModelInModelExplorer(); + + // Back to the Properties view + editor.getView(PROPERTY_SHEET, false); + + memory.add(editor.getModel()); + } + + /** + * Verify that models with dynamic profiles applied (and the profiles and everything else) don't leak when the editor is closed + * (the case of profiles that do not have OCL constraints and, therefore, do not have {@link ETypedElement}s of {@link EGenericType} type). + */ + @Test + @SoftReferenceSensitive + @PluginResource("model/profile/model-no-j2ee-constraints.di") + public void testProfileContentDoesNotLeak_noEGenericTypes() { + // Activate the Properties view + editor.getView(PROPERTY_SHEET, true); + + // Select the Model element to show it in the Properties + fixture.selectModelInModelExplorer(); + + // Back to the Properties view + editor.getView(PROPERTY_SHEET, false); + + memory.add(editor.getModel()); + memory.add(editor.getModel().getAppliedProfile("j2ee")); + } + + /** + * Verify that models with dynamic profiles applied (and the profiles and everything else) don't leak when when validation is run on them + * (the case of profiles that do not have OCL constraints and, therefore, do not have {@link ETypedElement}s of {@link EGenericType} type). + */ + @Test + @SoftReferenceSensitive + @PluginResource("model/profile/model-no-j2ee-constraints.di") + public void testValidatedProfiledModelContentDoesNotLeak_noEGenericTypes() { + // Validate the model + try { + new ValidateModelCommand(editor.getModel()).execute(new NullProgressMonitor(), null); + } catch (ExecutionException e) { + e.printStackTrace(); + fail("Failed to validate model: " + e.getLocalizedMessage()); + } + + // The validation command activated the Model Validation view. Return to Properties + editor.getView(PROPERTY_SHEET, false); + + editor.flushDisplayEvents(); + + memory.add(editor.getModel()); + memory.add(editor.getModel().getAppliedProfile("j2ee")); + } + + /** + * Verify that models with dynamic profiles applied (and the profiles and everything else) don't leak when the editor is closed + * (the case of profiles that have OCL constraints and, therefore, do have {@link ETypedElement}s of {@link EGenericType} type). + */ + @Test + @SoftReferenceSensitive + @PluginResource("model/profile/model.di") + public void testProfileContentDoesNotLeak() { + // Activate the Properties view + editor.getView(PROPERTY_SHEET, true); + + // Select the Model element to show it in the Properties + fixture.selectModelInModelExplorer(); + + // Back to the Properties view + editor.getView(PROPERTY_SHEET, false); + + memory.add(editor.getModel()); + memory.add(editor.getModel().getAppliedProfile("j2ee")); + } + + /** + * Verify that models with dynamic profiles applied (and the profiles and everything else) don't leak when when validation is run on them + * (the case of profiles that have OCL constraints and, therefore, do have {@link ETypedElement}s of {@link EGenericType} type). + */ + @Test + @SoftReferenceSensitive + @PluginResource("model/profile/model.di") + public void testValidatedProfiledModelContentDoesNotLeak() { + // Validate the model + try { + new ValidateModelCommand(editor.getModel()).execute(new NullProgressMonitor(), null); + } catch (ExecutionException e) { + e.printStackTrace(); + fail("Failed to validate model: " + e.getLocalizedMessage()); + } + + // The validation command activated the Model Validation view. Return to Properties + editor.getView(PROPERTY_SHEET, false); + + editor.flushDisplayEvents(); + + memory.add(editor.getModel()); + memory.add(editor.getModel().getAppliedProfile("j2ee")); + } + + /** + * Verify that the attachment of listeners to the UML's shared item providers doesn't + * cause any leaks (all is properly cleaned up when unloading the editor). + */ + @Test + @SoftReferenceSensitive + @PluginResource("model/basic/unnamed_diagram.di") + public void testCleanUpListenersOnItemProviders() { + memory.add(editor.getModelSet()); + + DiagramEditor diagramEditor = (DiagramEditor) editor.getEditor().getActiveEditor(); + memory.add(diagramEditor.getDiagramEditPart()); + } +} diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorReloadTest.java b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorReloadTest.java new file mode 100644 index 00000000000..cd443491697 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditorReloadTest.java @@ -0,0 +1,719 @@ +/* + * 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.editor.integration.tests.tests; + +import static org.eclipse.papyrus.junit.matchers.DiagramMatchers.collapsedIn; +import static org.eclipse.papyrus.junit.matchers.DiagramMatchers.editPartSelected; +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.lang.reflect.Method; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Set; +import java.util.regex.Pattern; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.edit.command.CommandParameter; +import org.eclipse.emf.edit.command.SetCommand; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.palette.PaletteContainer; +import org.eclipse.gef.palette.PaletteDrawer; +import org.eclipse.gef.palette.PaletteEntry; +import org.eclipse.gef.palette.PaletteStack; +import org.eclipse.gef.palette.ToolEntry; +import org.eclipse.gef.ui.palette.PaletteViewer; +import org.eclipse.gef.ui.views.palette.PaletteView; +import org.eclipse.jface.viewers.AbstractTreeViewer; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer; +import org.eclipse.papyrus.infra.core.services.IService; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.core.utils.AdapterUtils; +import org.eclipse.papyrus.infra.emf.utils.EMFHelper; +import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; +import org.eclipse.papyrus.junit.framework.classification.ExpensiveTest; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.eclipse.papyrus.junit.utils.Duck; +import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture; +import org.eclipse.papyrus.junit.utils.rules.PluginResource; +import org.eclipse.papyrus.junit.utils.rules.ShowView; +import org.eclipse.papyrus.junit.utils.rules.ShowView.Location; +import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView; +import org.eclipse.swt.widgets.Item; +import org.eclipse.swt.widgets.TreeItem; +import org.eclipse.swt.widgets.Widget; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.navigator.CommonViewer; +import org.eclipse.ui.part.IPage; +import org.eclipse.ui.part.PageBookView; +import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.OpaqueAction; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.VisibilityKind; +import org.eclipse.uml2.uml.resource.UMLResource; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import com.google.common.base.Splitter; +import com.google.common.base.Supplier; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; + + +/** + * Test cases checking that various different scenarios in Papyrus editor re-loading for changes in resource dependencies. + * + * @see bug 437217 + */ +@ExpensiveTest +@PluginResource({ EditorReloadTest.EMPLOYMENT_MODEL, EditorReloadTest.BANKING_MODEL, EditorReloadTest.LIBRARY_MODEL }) +public class EditorReloadTest extends AbstractPapyrusTest { + + static final String PROPERTY_SHEET_VIEW_ID = "org.eclipse.ui.views.PropertySheet"; + + static final String EMPLOYMENT_MODEL = "model/reload/employment.di"; + + static final String BANKING_MODEL = "model/reload/banking.di"; + + static final String LIBRARY_MODEL = "model/reload/library.di"; + + @Rule + public final PapyrusEditorFixture editorFixture = new PapyrusEditorFixture(); + + private IMultiDiagramEditor employmentEditor; + + private IMultiDiagramEditor bankingEditor; + + private IMultiDiagramEditor libraryEditor; + + public EditorReloadTest() { + super(); + } + + /** + * Verify that dependent editors are not re-loaded immediately (this is deferred until they are activated). + */ + @Test + public void testReloadIsDeferred() { + final ReloadAssertion reload = new ReloadAssertion(employmentEditor, bankingEditor); + + pokeLibraryModel(); + editorFixture.save(libraryEditor); + + reload.assertNotReloaded(); + } + + /** + * Verify that re-loading two dependent editors doesn't mess up the perspective layout. + */ + @Test + public void testPerspectiveLayoutUnperturbed() { + final ReloadAssertion reload = new ReloadAssertion(employmentEditor, bankingEditor); + + pokeLibraryModel(); + reload.save(libraryEditor); + + // The ordering and separation of editor stacks is unchanged + assertThat(editorFixture.getPartStack(employmentEditor), is(Arrays. asList(employmentEditor, libraryEditor))); + assertThat(editorFixture.getPartStack(bankingEditor), is(Arrays. asList(bankingEditor))); + } + + /** + * Verify that, after a Save All action that saves a non-active editor causing the active editor to re-load in place, + * the originally active editor is active once again. + */ + @Test + public void testActiveEditorRestoredSaveAll() { + final ReloadAssertion reload = new ReloadAssertion(employmentEditor); + + pokeLibraryModel(); + editorFixture.activate(employmentEditor); + editorFixture.saveAll(); + + reload.assertReloaded(); // The editor is reloaded immediately because it is already active + + assertThat(employmentEditor.getSite().getPage().getActiveEditor(), is((IEditorPart)employmentEditor)); + } + + /** + * Verify that the nested editor that was active is active again after the re-load. + */ + @Test + public void testActiveDiagramRestored() { + final String diagramTitle = "ActivityDiagram"; + final ReloadAssertion reload = new ReloadAssertion(employmentEditor); + + editorFixture.activate(employmentEditor); + editorFixture.activateDiagram(employmentEditor, diagramTitle); + + pokeLibraryModel(); + reload.save(libraryEditor); + + editorFixture.activate(employmentEditor); + assertThat(employmentEditor.getActiveEditor(), notNullValue()); + assertThat(employmentEditor.getActiveEditor().getTitle(), is(diagramTitle)); + } + + /** + * Verify that edit-part selections in a diagram are restored after the re-load. + */ + @Test + public void testEditPartSelectionRestored() { + final String diagramTitle = "ActivityDiagram"; + final String nodeName = "do work"; + final ReloadAssertion reload = new ReloadAssertion(employmentEditor); + + EditPart activityNode = editorFixture.activateDiagram(employmentEditor, diagramTitle).findEditPart(nodeName, OpaqueAction.class); + editorFixture.select(activityNode); + + pokeLibraryModel(); + reload.save(libraryEditor); + + activityNode = editorFixture.activateDiagram(employmentEditor, diagramTitle).findEditPart(nodeName, OpaqueAction.class); + + assertThat(activityNode, notNullValue()); + assertThat(activityNode, editPartSelected()); + } + + /** + * Verify that drawer, stack, and tool state in the palette is restored after editor re-load. + */ + @Test + public void testPaletteStateRestored() { + doTestPaletteStateRestored(); + } + + /** + * Verify that drawer, stack, and tool state in the Palette View is restored after editor re-load. + */ + @ShowView(PaletteView.ID) + @Test + public void testPaletteStateRestored_paletteView() { + doTestPaletteStateRestored(); + } + + void doTestPaletteStateRestored() { + final String diagramTitle = "ActivityDiagram"; + final String drawerLabel = "Edges"; + final String stackLabel = "ControlNodes"; + final String stackEntryLabel = "Activity final"; + final String activeToolLabel = "Comment"; + final ReloadAssertion reload = new ReloadAssertion(employmentEditor); + + PaletteViewer palette = editorFixture.activateDiagram(employmentEditor, diagramTitle).getPalette(); + + // Collapse the Edges drawer + PaletteDrawer edges = find(palette.getPaletteRoot(), drawerLabel, PaletteDrawer.class); + new Duck(palette.getEditPartRegistry().get(edges)).quack("setExpanded", false); + + // Select the Activity Final Node in the control nodes stack + PaletteStack stack = find(palette.getPaletteRoot(), stackLabel, PaletteStack.class); + stack.setActiveEntry(find(stack, stackEntryLabel, ToolEntry.class)); + + // And make the Comment tool active + palette.setActiveTool(find(palette.getPaletteRoot(), activeToolLabel, ToolEntry.class)); + + editorFixture.flushDisplayEvents(); + + pokeLibraryModel(); + reload.save(libraryEditor); + + palette = editorFixture.activateDiagram(employmentEditor, diagramTitle).getPalette(); + + // Verify the Edges drawer + edges = find(palette.getPaletteRoot(), drawerLabel, PaletteDrawer.class); + assertThat(edges, collapsedIn(palette)); + + // Verify Activity Final Node selection in its stack + stack = find(palette.getPaletteRoot(), stackLabel, PaletteStack.class); + assertThat(stack.getActiveEntry().getLabel(), is(stackEntryLabel)); + + // Verify the active tool + assertThat(palette.getActiveTool().getLabel(), is(activeToolLabel)); + } + + @ShowView(value = ModelExplorerPageBookView.VIEW_ID, location = Location.LEFT) + @Test + public void testModelExplorerSelectionRestored() { + final ReloadAssertion reload = new ReloadAssertion(employmentEditor); + + editorFixture.activate(employmentEditor); + + Set selectedLabels = ImmutableSet.of("employment::Company", "types::Name::firstName"); + + reload.verifySelection(modelExplorerSupplier(), selectedLabels); + } + + @ShowView(value = ModelExplorerPageBookView.VIEW_ID, location = Location.LEFT) + @Test + public void testModelExplorerExpansionRestored() { + final ReloadAssertion reload = new ReloadAssertion(employmentEditor); + + editorFixture.activate(employmentEditor); + + Set expandedLabels = ImmutableSet.of("employment::A_company_person_1", "types::UML Primitive Types::PrimitiveTypes::Real"); + + reload.verifyExpansion(modelExplorerSupplier(), expandedLabels); + } + + @ShowView(value = ModelExplorerPageBookView.VIEW_ID, location = Location.LEFT) + @Test + public void testModelExplorerReferencedLibrariesRestored() { + final ReloadAssertion reload = new ReloadAssertion(employmentEditor); + + editorFixture.activate(employmentEditor); + + // Load something we haven't loaded before + editorFixture.getModelSet(employmentEditor).getResource(URI.createURI(UMLResource.JAVA_PRIMITIVE_TYPES_LIBRARY_URI), true); + editorFixture.flushDisplayEvents(); + + Set selectedLabels = ImmutableSet.of("Java Primitive Types::Long"); + + reload.verifySelection(modelExplorerSupplier(), selectedLabels); + } + + @ShowView(value = { ModelExplorerPageBookView.VIEW_ID, PROPERTY_SHEET_VIEW_ID }, location = { Location.LEFT, Location.BELOW }) + @Test + public void testPropertySheetRestoredShowingCorrectInput() { + final ReloadAssertion reload = new ReloadAssertion(employmentEditor); + + pokeLibraryModel(); + pokeEmploymentModel(); // And this one, too! + + EditPart companyClassEP = editorFixture.activateDiagram(employmentEditor, "classes").findEditPart("Company", org.eclipse.uml2.uml.Class.class); + assertThat(companyClassEP, notNullValue()); + editorFixture.select(companyClassEP); + editorFixture.flushDisplayEvents(); + + EObject propertySheetSelection = getPropertySheetSelection(); + assertThat(propertySheetSelection, is(EMFHelper.getEObject(companyClassEP))); + + editorFixture.activate(editorFixture.getView(ModelExplorerPageBookView.VIEW_ID, false)); + Set selectedLabels = ImmutableSet.of("employment::Person"); + reload.select(modelExplorerSupplier(), selectedLabels); + editorFixture.flushDisplayEvents(); + + editorFixture.saveAll(); + + reload.assertReloaded(); // The editor is reloaded immediately because it is already active + + editorFixture.flushDisplayEvents(); + + // The property sheet still has the Person class selected, not Company + propertySheetSelection = getPropertySheetSelection(); + assertThat(propertySheetSelection, instanceOf(org.eclipse.uml2.uml.Class.class)); + assertThat(((org.eclipse.uml2.uml.Class)propertySheetSelection).getName(), is("Person")); + } + + /** + * Verifies that where an editor is organized with multiple sash folders, the correct tab is active overall and the + * correct tab in each sash pane is visible (not just the last tab in each pane). + */ + @PluginResource({ "model/reload/employment_sashes.di", EditorReloadTest.LIBRARY_MODEL }) + @Test + public void testSashFoldersRestored() { + employmentEditor = editorFixture.getEditor("model/reload/employment_sashes.di"); + final ReloadAssertion reload = new ReloadAssertion(employmentEditor); + + ISashWindowsContainer sashContainer = AdapterUtils.adapt(employmentEditor, ISashWindowsContainer.class, null); + + // On opening, the table is visible because it's the last tab in its folder + Set visible = getVisiblePages(sashContainer); + assertThat(visible, is((Set)ImmutableSet.of("classes", "classes_table"))); + + // So, activate the activity diagram + editorFixture.activateDiagram(employmentEditor, "activity"); + + // Then activate the class diagram again so that being the active diagram isn't the reason why the activity + // diagram is restored to visible state + editorFixture.activateDiagram(employmentEditor, "classes"); + + pokeLibraryModel(); + editorFixture.activate(employmentEditor); + editorFixture.saveAll(); + reload.assertReloaded(); // The editor is reloaded immediately because it is already active + editorFixture.flushDisplayEvents(); + + sashContainer = AdapterUtils.adapt(employmentEditor, ISashWindowsContainer.class, null); + + // After re-load, the activity diagram is the visible one in its folder + visible = getVisiblePages(sashContainer); + assertThat(visible, is((Set)ImmutableSet.of("classes", "activity"))); + + // But the activity diagram isn't visible because it's the active page + assertThat(sashContainer.getActiveSashWindowsPage().getPageTitle(), is("classes")); + } + + // + // Test framework + // + + @Before + public void layOutWorkbenchPage() { + employmentEditor = editorFixture.getEditor(EMPLOYMENT_MODEL); + bankingEditor = editorFixture.getEditor(BANKING_MODEL); + libraryEditor = editorFixture.getEditor(LIBRARY_MODEL); + + // Non-standard test cases will not have one of these + if((employmentEditor != null) && (bankingEditor != null) && (libraryEditor != null)) { + // Move the banking editor into its own part of the editor area + editorFixture.splitEditorArea(bankingEditor, false); + } + } + + void pokeLibraryModel() { + // First, make sure that the library editor is active (user can't edit it, otherwise!) + editorFixture.activate(libraryEditor); + + Package library = editorFixture.getModel(libraryEditor); + Type ssn = library.getOwnedType("SSN"); + EditingDomain domain = editorFixture.getEditingDomain(libraryEditor); + domain.getCommandStack().execute(domain.createCommand(SetCommand.class, new CommandParameter(ssn, UMLPackage.Literals.NAMED_ELEMENT__NAME, "SocialSecurityNumber"))); + } + + void pokeEmploymentModel() { + // First, make sure that the library editor is active (user can't edit it, otherwise!) + editorFixture.activate(employmentEditor); + + Package employment = editorFixture.getModel(employmentEditor); + Type person = employment.getOwnedType("Person"); + EditingDomain domain = editorFixture.getEditingDomain(employmentEditor); + domain.getCommandStack().execute(domain.createCommand(SetCommand.class, new CommandParameter(person, UMLPackage.Literals.NAMED_ELEMENT__VISIBILITY, VisibilityKind.PUBLIC_LITERAL))); + } + +

P find(PaletteContainer container, String label, Class

type) { + P result = null; + + for(P next : Iterables.filter(container.getChildren(), type)) { + if(label.equalsIgnoreCase(next.getLabel())) { + result = next; + break; + } + } + + if(result == null) { + for(PaletteContainer next : Iterables.filter(container.getChildren(), PaletteContainer.class)) { + result = find(next, label, type); + if(result != null) { + break; + } + } + } + + return result; + } + + Set getLabels(Item... items) { + Set result = Sets.newHashSet(); + + for(Item next : items) { + result.add(getLabel(next)); + } + + return result; + } + + TreeItem[] getItems(AbstractTreeViewer tree, Collection labels) { + List result = Lists.newArrayListWithCapacity(labels.size()); + + for(String next : labels) { + Widget search = tree.getControl(); + for(String part : Splitter.on(NamedElement.SEPARATOR).split(next)) { + search = findItem(tree, search, part); + } + + if(search instanceof TreeItem) { + result.add((TreeItem)search); + } + } + + return Iterables.toArray(result, TreeItem.class); + } + + static final Pattern METACLASS_QUALIFIER = Pattern.compile("<.+>"); + + static final Pattern STEREOTYPE_QUALIFIER = Pattern.compile("«.+»"); + + static String getLabel(Item item) { + String result = item.getText(); + + if(result != null) { + result = METACLASS_QUALIFIER.matcher(result).replaceAll(""); + result = STEREOTYPE_QUALIFIER.matcher(result).replaceAll(""); + result = result.trim(); + } + + return result; + } + + private Item findItem(AbstractTreeViewer tree, Widget parent, String label) { + Item result = null; + + if(parent != null) { + if(parent instanceof TreeItem) { + tree.expandToLevel(parent.getData(), 1); + } + + for(Item next : (Item[])new Duck(parent).quack("getItems")) { + if(label.equals(getLabel(next))) { + result = next; + break; + } + } + } + + return result; + } + + Supplier modelExplorerSupplier() { + return new Supplier() { + + public CommonViewer get() { + return editorFixture.getModelExplorerView().getCommonViewer(); + } + }; + } + + EObject getPropertySheetSelection() { + IViewPart propertySheet = editorFixture.getView(PROPERTY_SHEET_VIEW_ID, true); + assertThat(propertySheet, instanceOf(PageBookView.class)); + IPage currentPage = ((PageBookView)propertySheet).getCurrentPage(); + assertThat(currentPage, instanceOf(TabbedPropertySheetPage.class)); + TabbedPropertySheetPage tabbed = (TabbedPropertySheetPage)currentPage; + + IStructuredSelection result = null; + + try { + Method getCurrentSelection = TabbedPropertySheetPage.class.getDeclaredMethod("getCurrentSelection"); + getCurrentSelection.setAccessible(true); + result = (IStructuredSelection)getCurrentSelection.invoke(tabbed); + assertThat("Nothing selected in property sheet", (result == null) || result.isEmpty(), is(false)); + } catch (Exception e) { + e.printStackTrace(); + fail("Failed to get property sheet selection: " + e.getLocalizedMessage()); + } + + return EMFHelper.getEObject(result.getFirstElement()); + } + + Set getVisiblePages(ISashWindowsContainer sashContainer) { + Set result = Sets.newHashSet(); + + for(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage page : sashContainer.getVisiblePages()) { + result.add(page.getPageTitle()); + } + + return result; + } + + private class ReloadAssertion { + + private final Set editors; + + private final Set unloaded = Sets.newHashSet(); + + ReloadAssertion(IMultiDiagramEditor... editor) { + this.editors = Sets.newHashSet(editor); + + for(IMultiDiagramEditor next : editors) { + ServicesRegistry services = next.getServicesRegistry(); + + try { + services.add(Canary.class, 1, new Canary(next)); + services.startServicesByClassKeys(Canary.class); + } catch (ServiceException e) { + e.printStackTrace(); + fail("Failed to start Canary service: " + e.getLocalizedMessage()); + } + } + } + + /** + * Saves the specified editor, kicks the registered dependent editors by activating them, and asserts that they were re-loaded. + */ + void save(IMultiDiagramEditor editor) { + editorFixture.save(editor); + kick(); + assertReloaded(); + } + + void kick() { + if(!editors.isEmpty()) { + IWorkbenchPage page = Iterables.getFirst(editors, null).getSite().getPage(); + IEditorPart active = page.getActiveEditor(); + + for(IEditorPart next : editors) { + // Activate this editor to trigger reload + page.activate(next); + } + + if(active != null) { + // Restore the active editor + page.activate(active); + } + + editorFixture.flushDisplayEvents(); + } + } + + void verifySelection(Supplier viewerSupplier, Set selectedLabels) { + assertThat("Must have exactly one dependent editor registered for test.", editors.size(), is(1)); + + final IMultiDiagramEditor dependent = Iterables.getOnlyElement(editors); + + Set selectedObjects = select(viewerSupplier, selectedLabels); + + editorFixture.activate(dependent); + + Set selectedAgain = getSelection(viewerSupplier); + + assertThat(selectedAgain, is(selectedObjects)); + } + + Set select(Supplier viewerSupplier, Set selectedLabels) { + org.eclipse.jface.viewers.TreeViewer viewer = viewerSupplier.get(); + + Set result = Sets.newHashSet(); + List selection = Lists.newArrayListWithCapacity(selectedLabels.size()); + for(TreeItem item : getItems(viewer, selectedLabels)) { + selection.add(item.getData()); + EObject object = EMFHelper.getEObject(item.getData()); + result.add(EcoreUtil.getURI(object)); + } + + viewer.setSelection(new StructuredSelection(selection)); + + return result; + } + + Set getSelection(Supplier viewerSupplier) { + org.eclipse.jface.viewers.TreeViewer viewer = viewerSupplier.get(); + Set result = Sets.newHashSet(); + for(Object next : ((IStructuredSelection)viewer.getSelection()).toList()) { + EObject object = EMFHelper.getEObject(next); + result.add(EcoreUtil.getURI(object)); + } + return result; + } + + void verifyExpansion(Supplier viewerSupplier, Set expandedLabels) { + assertThat("Must have exactly one dependent editor registered for test.", editors.size(), is(1)); + + final IMultiDiagramEditor dependent = Iterables.getOnlyElement(editors); + org.eclipse.jface.viewers.TreeViewer viewer = viewerSupplier.get(); + + for(TreeItem next : getItems(viewer, expandedLabels)) { + next.setExpanded(true); + } + Set expandedObjects = Sets.newHashSet(); + for(Object next : viewer.getExpandedElements()) { + EObject object = EMFHelper.getEObject(next); + expandedObjects.add(EcoreUtil.getURI(object)); + } + + pokeLibraryModel(); + save(libraryEditor); + + editorFixture.activate(dependent); + + viewer = viewerSupplier.get(); + Set expandedAgain = Sets.newHashSet(); + for(Object next : viewer.getExpandedElements()) { + EObject object = EMFHelper.getEObject(next); + expandedAgain.add(EcoreUtil.getURI(object)); + } + assertThat(expandedAgain, is(expandedObjects)); + + } + + void assertUnloaded() { + assertThat("Some editors were not unloaded", unloaded, is(editors)); + } + + void assertLoaded() { + for(IMultiDiagramEditor next : editors) { + try { + boolean loaded = next.getServicesRegistry().isStarted(ModelSet.class.getName()); + assertThat("Editor not loaded: " + next.getTitle(), loaded, is(true)); + } catch (ServiceException e) { + e.printStackTrace(); + fail("Editor not loaded: " + next.getTitle()); + } + } + } + + void assertReloaded() { + assertUnloaded(); + assertLoaded(); + } + + void assertNotUnloaded() { + assertThat("Some editors were unloaded", Sets.difference(editors, unloaded), is(editors)); + } + + void assertNotReloaded() { + assertNotUnloaded(); + assertLoaded(); + } + + private class Canary implements IService { + + private final IMultiDiagramEditor editor; + + private ServicesRegistry services; + + Canary(IMultiDiagramEditor editor) { + this.editor = editor; + } + + public void init(ServicesRegistry servicesRegistry) throws ServiceException { + services = servicesRegistry; + + // For symmetry only; this never actually has any effect + unloaded.remove(editor); + } + + public void disposeService() throws ServiceException { + unloaded.add(editor); + services = null; + } + + public void startService() throws ServiceException { + // Load everything in the resource set so that we are sure to know of the dependency on the library model + EcoreUtil.resolveAll(services.getService(ModelSet.class)); + } + } + + } +} diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/ModelSetTests.java b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/ModelSetTests.java new file mode 100644 index 00000000000..79f6099c62b --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/ModelSetTests.java @@ -0,0 +1,128 @@ +/***************************************************************************** + * 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.editor.integration.tests.tests; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.papyrus.commands.ICreationCommand; +import org.eclipse.papyrus.editor.integration.tests.Activator; +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.ExtensionServicesRegistry; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.core.utils.DiResourceSet; +import org.eclipse.papyrus.infra.ui.extension.commands.IModelCreationCommand; +import org.eclipse.papyrus.junit.utils.EditorUtils; +import org.eclipse.papyrus.uml.diagram.clazz.CreateClassDiagramCommand; +import org.eclipse.papyrus.uml.diagram.clazz.UmlClassDiagramForMultiEditor; +import org.eclipse.papyrus.uml.diagram.common.commands.CreateUMLModelCommand; +import org.eclipse.papyrus.uml.tools.model.UmlModel; +import org.eclipse.swt.widgets.Display; +import org.eclipse.uml2.uml.Model; +import org.junit.Assert; +import org.junit.Test; + +/** + * Test case for handling models with special characters in their name/path + * + * @author Camille Letavernier + * + */ +public class ModelSetTests extends AbstractEditorIntegrationTest { + + public static final String SOURCE_PATH = "/model/model set/"; + + @Test + public void testOpenModelWithSpecialChars() throws Exception { + initModel("openSpecialChars", "^&_&^", getBundle()); + IPageManager pageManager = getPageManager(); + //Fix test to match re-specification in Bug 429242: we only expect 2 pages (Instead of 3), because one of them is + //now invalid (Table v1 framework is deprecated and not available anymore) + Assert.assertEquals("Some pages cannot be found", 2, pageManager.allPages().size()); + + UmlModel umlModel = (UmlModel)getModelSet().getModel(UmlModel.MODEL_ID); + Model rootModel = (Model)umlModel.lookupRoot(); + Assert.assertEquals("The UML Model has not been correctly loaded", 3, rootModel.getOwnedElements().size()); + } + + @Test + public void testCreateModelWithSpecialChars() throws Exception { + ModelSet modelSet = new DiResourceSet(); + IProject emptyModelCreationProject = ResourcesPlugin.getWorkspace().getRoot().getProject("diagramCreationWithSpecialChars"); + emptyModelCreationProject.create(new NullProgressMonitor()); + emptyModelCreationProject.open(new NullProgressMonitor()); + + String modelName = "++n�w m�d�l & sp�c��l ch�r$++"; + + final IFile emptyModelDi = emptyModelCreationProject.getFile(modelName + ".di"); + + modelSet.createsModels(emptyModelDi); + + IFile emptyModelNotation = emptyModelCreationProject.getFile(modelName + ".notation"); + IFile emptyModelUml = emptyModelCreationProject.getFile(modelName + ".uml"); + + ServicesRegistry registry = new ExtensionServicesRegistry(org.eclipse.papyrus.infra.core.Activator.PLUGIN_ID); + try { + registry.add(ModelSet.class, Integer.MAX_VALUE, modelSet); + registry.startRegistry(); + } catch (ServiceException ex) { + //Ignore + } + + IModelCreationCommand creationCommand = new CreateUMLModelCommand(); + creationCommand.createModel(modelSet); + + //Create the root UML Model + UmlModel umlModel = (UmlModel)modelSet.getModel(UmlModel.MODEL_ID); + Model model = (Model)umlModel.lookupRoot(); + + //Creates and opens a Papyrus Class Diagram + ICreationCommand diagramCreationCommand = new CreateClassDiagramCommand(); + diagramCreationCommand.createDiagram(modelSet, model, modelName); + + modelSet.save(new NullProgressMonitor()); + + Assert.assertTrue("The DI file has not been created", emptyModelDi.exists()); + Assert.assertTrue("The Notation file has not been created", emptyModelNotation.exists()); + Assert.assertTrue("The UML file has not been created", emptyModelUml.exists()); + + Display.getDefault().syncExec(new Runnable() { + + public void run() { + try { + editor = EditorUtils.openPapyrusEditor(emptyModelDi); + } catch (Exception ex) { + Activator.log.error(ex); + Assert.fail(ex.getMessage()); + } + } + }); + + Assert.assertNotNull("Cannot open the Papyrus editor", editor); + Assert.assertTrue("The active editor should be a Papyrus Class Diagram editor", editor.getActiveEditor() instanceof UmlClassDiagramForMultiEditor); + + try { + registry.disposeRegistry(); + } catch (ServiceException ex) { + //Ignore + } + + } + + @Override + protected String getSourcePath() { + return SOURCE_PATH; + } +} diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/PageManagerTests.java b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/PageManagerTests.java new file mode 100644 index 00000000000..4bbcfb5f3c1 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/PageManagerTests.java @@ -0,0 +1,567 @@ +/***************************************************************************** + * Copyright (c) 2013, 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) - bug 433371 + * Christian W. Damus - bug 485220 + * + *****************************************************************************/ +package org.eclipse.papyrus.editor.integration.tests.tests; + +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.CompoundCommand; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gmf.runtime.common.core.command.CompositeCommand; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.papyrus.commands.DestroyElementPapyrusCommand; +import org.eclipse.papyrus.commands.ICreationCommand; +import org.eclipse.papyrus.commands.OpenDiagramCommand; +import org.eclipse.papyrus.editor.integration.tests.Activator; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.sasheditor.editor.IPage; +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.ExtensionServicesRegistry; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.core.utils.DiResourceSet; +import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper; +import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils; +import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; +import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; +import org.eclipse.papyrus.infra.ui.extension.commands.IModelCreationCommand; +import org.eclipse.papyrus.junit.utils.EditorUtils; +import org.eclipse.papyrus.uml.diagram.clazz.CreateClassDiagramCommand; +import org.eclipse.papyrus.uml.diagram.clazz.UmlClassDiagramForMultiEditor; +import org.eclipse.papyrus.uml.diagram.common.commands.CreateUMLModelCommand; +import org.eclipse.papyrus.uml.diagram.sequence.UmlSequenceDiagramForMultiEditor; +import org.eclipse.papyrus.uml.diagram.timing.custom.UmlTimingDiagramForMultiEditor; +import org.eclipse.papyrus.uml.tools.model.UmlModel; +import org.eclipse.papyrus.uml.tools.model.UmlUtils; +import org.eclipse.swt.widgets.Display; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.BehavioredClassifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Model; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Tests the basic PageManager cases, integrated with the CoreMultiDiagramEditor + * and a few UML Diagrams/Tables + * + * @author Camille Letavernier + * + */ +public class PageManagerTests extends AbstractEditorIntegrationTest { + + public static final String SOURCE_PATH = "/model/basic/"; + + @Test + public void testModelWithDiagramCreation() throws Exception { + ModelSet modelSet = new DiResourceSet(); + IProject emptyModelCreationProject = ResourcesPlugin.getWorkspace().getRoot().getProject("diagramModelCreation"); + emptyModelCreationProject.create(new NullProgressMonitor()); + emptyModelCreationProject.open(new NullProgressMonitor()); + + final IFile emptyModelDi = emptyModelCreationProject.getFile("diagram_model_creation.di"); + + modelSet.createsModels(emptyModelDi); + + IFile emptyModelNotation = emptyModelCreationProject.getFile("diagram_model_creation.notation"); + IFile emptyModelUml = emptyModelCreationProject.getFile("diagram_model_creation.uml"); + + ServicesRegistry registry = new ExtensionServicesRegistry(org.eclipse.papyrus.infra.core.Activator.PLUGIN_ID); + try { + registry.add(ModelSet.class, Integer.MAX_VALUE, modelSet); + registry.startRegistry(); + } catch (ServiceException ex) { + // Ignore + } + + IModelCreationCommand creationCommand = new CreateUMLModelCommand(); + creationCommand.createModel(modelSet); + + // Create the root UML Model + UmlModel umlModel = (UmlModel) modelSet.getModel(UmlModel.MODEL_ID); + Model model = (Model) umlModel.lookupRoot(); + + // Creates and opens a Papyrus Class Diagram + ICreationCommand diagramCreationCommand = new CreateClassDiagramCommand(); + diagramCreationCommand.createDiagram(modelSet, model, "TestDiagram1"); + + modelSet.save(new NullProgressMonitor()); + + Assert.assertTrue("The DI file has not been created", emptyModelDi.exists()); + Assert.assertTrue("The Notation file has not been created", emptyModelNotation.exists()); + Assert.assertTrue("The UML file has not been created", emptyModelUml.exists()); + + Display.getDefault().syncExec(new Runnable() { + + public void run() { + try { + editor = EditorUtils.openPapyrusEditor(emptyModelDi); + } catch (Exception ex) { + Activator.log.error(ex); + Assert.fail(ex.getMessage()); + } + } + }); + + Assert.assertNotNull("Cannot open the Papyrus editor", editor); + Assert.assertTrue("The active editor should be a Papyrus Class Diagram editor", editor.getActiveEditor() instanceof UmlClassDiagramForMultiEditor); + + try { + registry.disposeRegistry(); + } catch (ServiceException ex) { + // Ignore + } + } + + @Test + public void testEmptyModelCreation() throws Exception { + final IFile emptyModelDi = createEmptyModel(); + Assert.assertNotNull(emptyModelDi); + + Display.getDefault().syncExec(new Runnable() { + + public void run() { + try { + editor = EditorUtils.openPapyrusEditor(emptyModelDi); + } catch (Exception ex) { + Activator.log.error(ex); + Assert.fail(ex.getMessage()); + } + } + }); + + Assert.assertNotNull("Cannot open the editor", editor); + openAndCheckCreatedModel(emptyModelDi); + } + + private IFile createEmptyModel() throws Exception { + ModelSet modelSet = new DiResourceSet(); + IProject emptyModelCreationProject = ResourcesPlugin.getWorkspace().getRoot().getProject("emptyModelCreation"); + emptyModelCreationProject.create(new NullProgressMonitor()); + emptyModelCreationProject.open(new NullProgressMonitor()); + + final IFile emptyModelDi = emptyModelCreationProject.getFile("empty_model_creation.di"); + + modelSet.createsModels(emptyModelDi); + + IModelCreationCommand creationCommand = new CreateUMLModelCommand(); + creationCommand.createModel(modelSet); + + modelSet.save(new NullProgressMonitor()); + + IFile emptyModelNotation = emptyModelCreationProject.getFile("empty_model_creation.notation"); + IFile emptyModelUml = emptyModelCreationProject.getFile("empty_model_creation.uml"); + + Assert.assertTrue("The DI file has not been created", emptyModelDi.exists()); + Assert.assertTrue("The Notation file has not been created", emptyModelNotation.exists()); + Assert.assertTrue("The UML file has not been created", emptyModelUml.exists()); + return emptyModelDi; + } + + private void openAndCheckCreatedModel(IFile emptyModelDi) throws Exception { + IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); + Assert.assertNotNull("Cannot retrieve the PageManager", pageManager); + Assert.assertTrue(pageManager.allPages().isEmpty()); + + ModelSet modelSet = editor.getServicesRegistry().getService(ModelSet.class); + Assert.assertNotNull("Cannot retrieve the ModelSet", modelSet); + + UmlModel umlModel = (UmlModel) modelSet.getModel(UmlModel.MODEL_ID); + Assert.assertNotNull("Cannot retrieve the UML Model", umlModel); + + EObject rootEObject = umlModel.lookupRoot(); + Assert.assertTrue("The rootElement is not a model", rootEObject instanceof Model); + } + + @Test + public void testOpenEmptyModel() throws Exception { + initModel("openEmptyModel", "empty_model", getBundle()); + IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); + Assert.assertEquals(0, pageManager.allPages().size()); + } + + @Test + public void testAvailableAndActivePage() throws Exception { + initModel("availableAndActivePage", "two_diagrams_model", getBundle()); + IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); + Assert.assertEquals(2, pageManager.allPages().size()); + + Assert.assertTrue(editor.getActiveEditor() instanceof UmlClassDiagramForMultiEditor); // TODO: The PageManager doesn't provide the getActivePage() method + + Resource notationResource = NotationUtils.getNotationModel(editor.getServicesRegistry().getService(ModelSet.class)).getResource(); + + Diagram classDiagram = (Diagram) notationResource.getContents().get(0); + Diagram timingDiagram = (Diagram) notationResource.getContents().get(1); + + TransactionalEditingDomain editingDomain = editor.getServicesRegistry().getService(TransactionalEditingDomain.class); + editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(new OpenDiagramCommand(editingDomain, timingDiagram))); + Assert.assertTrue(editor.getActiveEditor() instanceof UmlTimingDiagramForMultiEditor); + + + // Check type requested by selectPage + ISashWindowsContainer container = editor.getServicesRegistry().getService(ISashWindowsContainer.class); + IPage selectedPage = container.getActiveSashWindowsPage(); + + // FIXME: Does not work yet. See Bug 401107: [IPageManager] selectPage does not work + // TODO: There should be a specific test for selectPage, with a basic and a complex model + pageManager.selectPage(classDiagram); + Assert.assertTrue("Couldn't change the page selection", editor.getActiveEditor() instanceof UmlClassDiagramForMultiEditor); + + pageManager.selectPage(timingDiagram); + Assert.assertTrue("Couldn't change the page selection", editor.getActiveEditor() instanceof UmlTimingDiagramForMultiEditor); + } + + /** + * @author vincent lorenzo + * @throws Exception + */ + @Test + @Ignore("new papyrus table are not yet in the main build") + public void testAvailableAndActivePageWithNatTable() throws Exception { + // initModel("availableAndActivePage2", "two_tables_model"); + // IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); + // Assert.assertEquals(2, pageManager.allPages().size()); + // IEditorPart tableEditor = editor.getActiveEditor(); + // Assert.assertTrue(tableEditor instanceof NatTableEditor); //TODO: The PageManager doesn't provide the getActivePage() method + // INattableModelManager manager = (INattableModelManager)tableEditor.getAdapter(INattableModelManager.class); + // Assert.assertNotNull(manager); + // Assert.assertEquals("PapyrusGenericTable", manager.getTable().getTableConfiguration().getType()); + // + // Resource notationResource = NotationUtils.getNotationModel(editor.getServicesRegistry().getService(ModelSet.class)).getResource(); + // + // Table genericTable = (Table)notationResource.getContents().get(0); + // Table tableOfViews = (Table)notationResource.getContents().get(1); + // + // TransactionalEditingDomain editingDomain = editor.getServicesRegistry().getService(TransactionalEditingDomain.class); + // editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(new OpenDiagramCommand(editingDomain, tableOfViews))); + // tableEditor = editor.getActiveEditor(); + // Assert.assertTrue(tableEditor instanceof NatTableEditor); + // manager = (INattableModelManager)tableEditor.getAdapter(INattableModelManager.class); + // Assert.assertNotNull(manager); + // Assert.assertEquals("PapyrusViewsTable", manager.getTable().getTableConfiguration().getType()); + // + // //FIXME: Does not work yet. See Bug 401107: [IPageManager] selectPage does not work + // //TODO: There should be a specific test for selectPage, with a basic and a complex model + // pageManager.selectPage(genericTable); + // tableEditor = editor.getActiveEditor(); + // Assert.assertTrue(tableEditor instanceof NatTableEditor); //TODO: The PageManager doesn't provide the getActivePage() method + // manager = (INattableModelManager)tableEditor.getAdapter(INattableModelManager.class); + // Assert.assertNotNull(manager); + // Assert.assertEquals("Couldn't change the page selection", "PapyrusGenericTable", manager.getTable().getTableConfiguration().getType()); + // + // + // pageManager.selectPage(tableOfViews); + // tableEditor = editor.getActiveEditor(); + // Assert.assertTrue(tableEditor instanceof NatTableEditor); //TODO: The PageManager doesn't provide the getActivePage() method + // manager = (INattableModelManager)tableEditor.getAdapter(INattableModelManager.class); + // Assert.assertNotNull(manager); + // Assert.assertEquals("Couldn't change the page selection", "PapyrusViewsTable", manager.getTable().getTableConfiguration().getType()); + } + + @Test + public void testDiagramCreation() throws Exception { + initModel("diagramCreation", "empty_model", getBundle()); + ICreationCommand diagramCreationCommand = new CreateClassDiagramCommand(); + ModelSet modelSet = editor.getServicesRegistry().getService(ModelSet.class); + + TransactionalEditingDomain editingDomain = modelSet.getTransactionalEditingDomain(); + + CompositeCommand createAndOpenDiagram = new CompositeCommand("Create diagram"); + ICommand creationCommand = diagramCreationCommand.getCreateDiagramCommand(modelSet, null, "DiagramCreationTestDiagram"); + createAndOpenDiagram.add(creationCommand); + createAndOpenDiagram.add(new OpenDiagramCommand(editingDomain, creationCommand)); + + testPageCreation(createAndOpenDiagram, UmlClassDiagramForMultiEditor.class); + } + + @Test + public void testDiagramDeletion() throws Exception { + initModel("diagramDeletion", "simple_class_model", getBundle()); + ModelSet modelSet = getModelSet(); + final Diagram diagram = (Diagram) NotationUtils.getNotationModel(modelSet).getResource().getContents().get(0); + testPageDeletion(diagram, UmlClassDiagramForMultiEditor.class); + } + + @Test + public void testDiagramIndirectDeletion_bug433371() throws Exception { + initModel("bug433371", "delete_sash_page", getBundle()); + ModelSet modelSet = getModelSet(); + final Diagram diagram = (Diagram) NotationUtils.getNotationModel(modelSet).getResource().getContents().get(1); + + IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); + pageManager.selectPage(diagram); // Make sure the one we want deleted is active + + testPageDeletion(diagram.getElement(), diagram, UmlSequenceDiagramForMultiEditor.class); + } + + /** + * @author vincent lorenzo + * @throws Exception + */ + @Test + @Ignore("new papyrus table are not yet in the main build") + public void testNatTableDeletion() throws Exception { + // initModel("tableDeletion", "simple_uml_generic_table_model"); + // ModelSet modelSet = getModelSet(); + // final Table diagram = (Table)NotationUtils.getNotationModel(modelSet).getResource().getContents().get(0); + // testPageDeletion(diagram, NatTableEditor.class); + } + + // Does not work. The table creation produces two executable commands (Create Table Editor and Identity) + // Only Identity (which does nothing) is undoable. Undoing the table creation does nothing + // This is an EMF Facet Table bug, which tries to delete columns for an empty table as soon as the table is created + @Test + public void testTableCreation() throws Exception { + initModel("tableCreation", "empty_model", getBundle()); + + final ServicesRegistry registry = editor.getServicesRegistry(); + ModelSet modelSet = registry.getService(ModelSet.class); + TransactionalEditingDomain editingDomain = modelSet.getTransactionalEditingDomain(); + + final EObject tableContext = UmlUtils.getUmlModel(modelSet).getResource().getContents().get(0); + + + } + + + private void testPageCreation(ICommand creationCommand, Class expectedEditorClass) throws Exception { + IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); + + // Check initial state + Assert.assertTrue(pageManager.allPages().isEmpty()); + Assert.assertNull(editor.getActiveEditor()); + + EditingDomain editingDomain = editor.getServicesRegistry().getService(EditingDomain.class); + + editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(creationCommand)); + + for (int i = 0; i < 3; i++) { // Undo/Redo 3 times + Assert.assertEquals("The page has not been correctly created", 1, pageManager.allPages().size()); + Assert.assertTrue("The editor has not been correctly opened", expectedEditorClass.isInstance(editor.getActiveEditor())); + + editingDomain.getCommandStack().undo(); + + Assert.assertNull("The editor should be closed", editor.getActiveEditor()); + Assert.assertTrue("The page has not been correctly deleted", pageManager.allPages().isEmpty()); + + editingDomain.getCommandStack().redo(); + } + } + + private void testPageDeletion(final EObject page, Class expectedEditorClass) throws Exception { + final IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); + + // Check initial state + Assert.assertFalse(pageManager.allPages().isEmpty()); + int initialPagesSize = pageManager.allPages().size(); + + Assert.assertTrue(expectedEditorClass.isInstance(editor.getActiveEditor())); + + TransactionalEditingDomain editingDomain = editor.getServicesRegistry().getService(TransactionalEditingDomain.class); + + CompoundCommand command = new CompoundCommand("Delete diagram"); + + Command sashRemoveComd = new RecordingCommand(editingDomain, "Remove page") { + + @Override + protected void doExecute() { + pageManager.closeAllOpenedPages(page); + } + + }; + + command.append(sashRemoveComd); + command.append(new GMFtoEMFCommandWrapper(new DestroyElementPapyrusCommand(new DestroyElementRequest(page, false)))); + + editingDomain.getCommandStack().execute(command); + + for (int i = 0; i < 3; i++) { // Undo/Redo 3 times + Assert.assertNull("The editor should be closed", editor.getActiveEditor()); + Assert.assertEquals("The page has not been correctly deleted", initialPagesSize - 1, pageManager.allPages().size()); + + editingDomain.getCommandStack().undo(); + + Assert.assertEquals("The has not been correctly created", initialPagesSize, pageManager.allPages().size()); + Assert.assertTrue("The editor has not been correctly opened", expectedEditorClass.isInstance(editor.getActiveEditor())); + + editingDomain.getCommandStack().redo(); + } + } + + private void testPageDeletion(final EObject elementToDelete, final Object dependentPage, Class expectedEditorClass) throws Exception { + final IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); + + // Check initial state + assertThat("Page not open", pageManager.allPages(), hasItem(dependentPage)); + + assertThat("Wrong kind of page", editor.getActiveEditor(), instanceOf(expectedEditorClass)); + + TransactionalEditingDomain editingDomain = editor.getServicesRegistry().getService(TransactionalEditingDomain.class); + + Element clazz = getRootUMLModel().getOwnedType("Class1"); + Behavior toDelete = ((BehavioredClassifier) clazz).getOwnedBehaviors().get(0); + IElementEditService edit = ElementEditServiceUtils.getCommandProvider(clazz); + ICommand command = edit.getEditCommand(new DestroyElementRequest(toDelete, false)); + + editingDomain.getCommandStack().execute(GMFtoEMFCommandWrapper.wrap(command)); + + for (int i = 0; i < 3; i++) { // Undo/Redo 3 times + assertThat("The editor page should be closed", pageManager.allPages(), not(hasItem(dependentPage))); + + editingDomain.getCommandStack().undo(); + + assertThat("The page has not been correctly restored", pageManager.allPages(), hasItem(dependentPage)); + + editingDomain.getCommandStack().redo(); + } + } + + @Test + public void testContainedDiagramDeletion() throws Exception { + initModel("deleteContainedDiagrams", "delete_contained_diagram", getBundle()); + ModelSet modelSet = getModelSet(); + IPageManager pageManager = getPageManager(); + TransactionalEditingDomain editingDomain = getTransactionalEditingDomain(); + + final int initialSize = pageManager.allPages().size(); + Model model = (Model) UmlUtils.getUmlModel(modelSet).getResource().getContents().get(0); + + IElementEditService provider; + + Element firstRootElement = model.getOwnedElements().get(0); + Element secondRootElement = model.getOwnedElements().get(1); + + { + DestroyElementRequest destroyFirstElementRequest = new DestroyElementRequest(firstRootElement, false); + provider = ElementEditServiceUtils.getCommandProvider(firstRootElement); + ICommand destroyFirstElementCommand = provider.getEditCommand(destroyFirstElementRequest); + + editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(destroyFirstElementCommand)); + Assert.assertEquals("The page should have been destroyed", initialSize - 1, pageManager.allPages().size()); + // TODO: Test the opened pages too + } + + { + DestroyElementRequest destroySecondElementRequest = new DestroyElementRequest(secondRootElement, false); + provider = ElementEditServiceUtils.getCommandProvider(secondRootElement); + ICommand destroySecondElementCommand = provider.getEditCommand(destroySecondElementRequest); + + editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(destroySecondElementCommand)); + Assert.assertTrue("All remaining pages should have been destroyed", pageManager.allPages().isEmpty()); + } + + editingDomain.getCommandStack().undo(); + + Assert.assertEquals("The deleted pages should have been restored", initialSize - 1, pageManager.allPages().size()); + + editingDomain.getCommandStack().undo(); + + Assert.assertEquals("All pages should have been restored", initialSize, pageManager.allPages().size()); + + editingDomain.getCommandStack().redo(); + editingDomain.getCommandStack().redo(); + + Assert.assertTrue("All remaining pages should have been destroyed", pageManager.allPages().isEmpty()); + } + + /** + * @author vincent lorenzo + * @throws Exception + */ + @Test + public void testContainedNatTableDeletion() throws Exception { + initModel("deleteContainedNatTable", "delete_contained_table", getBundle()); + ModelSet modelSet = getModelSet(); + IPageManager pageManager = getPageManager(); + TransactionalEditingDomain editingDomain = getTransactionalEditingDomain(); + + final int initialSize = pageManager.allPages().size(); + Model model = (Model) UmlUtils.getUmlModel(modelSet).lookupRoot(); + + IElementEditService provider; + + Element firstRootElement = model.getOwnedElements().get(0); + Element secondRootElement = model.getOwnedElements().get(1); + + { + DestroyElementRequest destroyFirstElementRequest = new DestroyElementRequest(firstRootElement, false); + provider = ElementEditServiceUtils.getCommandProvider(firstRootElement); + ICommand destroyFirstElementCommand = provider.getEditCommand(destroyFirstElementRequest); + + editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(destroyFirstElementCommand)); + Assert.assertEquals("The page should have been destroyed", initialSize - 1, pageManager.allPages().size()); + // TODO: Test the opened pages too + } + + { + DestroyElementRequest destroySecondElementRequest = new DestroyElementRequest(secondRootElement, false); + provider = ElementEditServiceUtils.getCommandProvider(secondRootElement); + ICommand destroySecondElementCommand = provider.getEditCommand(destroySecondElementRequest); + + editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(destroySecondElementCommand)); + Assert.assertTrue("All remaining pages should have been destroyed", pageManager.allPages().isEmpty()); + } + + editingDomain.getCommandStack().undo(); + + Assert.assertEquals("The deleted pages should have been restored", initialSize - 1, pageManager.allPages().size()); + + editingDomain.getCommandStack().undo(); + + Assert.assertEquals("All pages should have been restored", initialSize, pageManager.allPages().size()); + + editingDomain.getCommandStack().redo(); + editingDomain.getCommandStack().redo(); + + Assert.assertTrue("All remaining pages should have been destroyed", pageManager.allPages().isEmpty()); + } + + @Ignore("Unsupported yet") + @Test + public void testContainedTableDeletion() throws Exception { + throw new UnsupportedOperationException("Not implemented yet"); + } + + @Test + public void testMultipageEditor() throws Exception { + initModel("multipageEditor", "complex_multipage_model", getBundle()); + } + + @Test + public void testOpenModel() throws Exception { + initModel("openModel", "complex_multipage_model", getBundle()); + } + + @Override + protected String getSourcePath() { + return SOURCE_PATH; + } + +} diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/RecoveryTest.java b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/RecoveryTest.java new file mode 100644 index 00000000000..18fb0ba9019 --- /dev/null +++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/RecoveryTest.java @@ -0,0 +1,175 @@ +/***************************************************************************** + * Copyright (c) 2013, 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 485220 + * + *****************************************************************************/ +package org.eclipse.papyrus.editor.integration.tests.tests; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.CompoundCommand; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.papyrus.commands.DestroyElementPapyrusCommand; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager; +import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper; +import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel; +import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils; +import org.eclipse.papyrus.uml.diagram.clazz.UmlClassDiagramForMultiEditor; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Tests the cases where the di model is not totally valid + * The Editor should be able to load the valid parts and should not + * fail on the invalid ones + * + * In most cases, we're simply interested in opening the Papyrus Editor + * (i.e. the model is invalid, so we don't expect to be able to manipulate + * the diagrams; but we should still be able to manipulate the editor + * and the semantic model, create new digrams, etc). + * + * @author Camille Letavernier + * + */ +public class RecoveryTest extends AbstractEditorIntegrationTest { + + private static final String SOURCE_PATH = "/model/recovery/"; + + // Should work + @Test + public void testInvalidAvailablePage() throws Exception { + initModel("invalidAvailablePage", "invalidAvailablePage", getBundle()); + Assert.assertTrue(editor.getActiveEditor() instanceof UmlClassDiagramForMultiEditor); + // IPageManager manager = editor.getServicesRegistry().getService(IPageManager.class); + // Is the page manager supposed to filter the invalid pages..? + // Assert.assertEquals(2, manager.allPages().size()); + } + + // Should work + // Bug 401109: [PageManager] Deleting an element which contains an opened page leads to critical model corruption + @Test + public void testInvalidTab() throws Exception { + initModel("invalidTab", "invalid_child_tab", getBundle()); + IPageManager manager = editor.getServicesRegistry().getService(IPageManager.class); + Assert.assertEquals(1, manager.allPages().size()); + } + + @Ignore("Recovery not supported") + // Not fixed yet + // Starts with an empty Di Model (All the contents have been erased, except the root xmi tag) + // We should be able to open a Papyrus editor and manipulate the PageManager + @Test + public void testEmptyDiModel() throws Exception { + initModel("emptyDiModel", "empty_di_model", getBundle()); + IPageManager manager = editor.getServicesRegistry().getService(IPageManager.class); + Assert.assertEquals(0, manager.allPages().size()); + NotationModel notationModel = (NotationModel) editor.getServicesRegistry().getService(ModelSet.class).getModel(NotationModel.MODEL_ID); + Assert.assertEquals(1, notationModel.getResource().getContents().size()); + Diagram diagram = (Diagram) notationModel.getResource().getContents().get(0); + manager.openPage(diagram); + Assert.assertEquals(1, manager.allPages().size()); + } + + // We should be able to open a page even if is not (yet) in the availablePages list + @Test + @Ignore("This test is not required anymore, as the allPages() is computed dynamically (Bug 429239)") + public void testUnavailablePageRecovery() throws Exception { + initModel("unavailablePageRecovery", "missing_page_recovery", getBundle()); + final IPageManager manager = editor.getServicesRegistry().getService(IPageManager.class); + int availablePages = manager.allPages().size(); + NotationModel notationModel = (NotationModel) editor.getServicesRegistry().getService(ModelSet.class).getModel(NotationModel.MODEL_ID); + Assert.assertEquals("Cannot find the diagram to open", 1, notationModel.getResource().getContents().size()); + + final Diagram diagram = (Diagram) notationModel.getResource().getContents().get(0); + + TransactionalEditingDomain domain = editor.getServicesRegistry().getService(TransactionalEditingDomain.class); + domain.getCommandStack().execute(new RecordingCommand(domain, "Open diagram") { + + @Override + protected void doExecute() { + manager.openPage(diagram); + } + }); + + Assert.assertEquals("A new page should be available", availablePages + 1, manager.allPages().size()); + } + + // Should work. The invalid tab is loaded as an "unresolved tab" and displays a warning. + @Test + public void testProxyDiagram() throws Exception { + initModel("proxyDiagram", "proxy_diagram_recovery", getBundle()); + IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); + Assert.assertEquals(2, pageManager.allPages().size()); + } + + @Ignore("Disabled because the Papyrus Editor opens a user dialog. Won't run on Hudson.") + // Should work + /** @see {link #testInvalidTab()} */ + @Test + public void testProxyTable() throws Exception { + initModel("proxyTable", "proxy_table_recovery", getBundle()); + // IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); + // Assert.assertEquals(2, pageManager.allPages()); + } + + // This model contains a few different errors (Unresolved proxy, invalid tabs, invalid available pages, ...) + @Test + public void testCompleteCase() throws Exception { + initModel("completeCase", "complex_invalid_model", getBundle()); + // IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); + // Assert.assertEquals(3, pageManager.allPages().size()); + } + + // We should be able to delete a diagram, even when there is an invalid page in the model + @Test + public void testDeleteDiagramWithInvalidAvailablePage() throws Exception { + initModel("deleteDiagramWithInvalidPage", "invalidAvailablePage", getBundle()); + + // Di layout: Diagram 0 - Invalid page - Diagram 1 + // We take the diagram at index 1 (i.e. after the invalid page) and try to delete it + final Diagram diagram = (Diagram) NotationUtils.getNotationModel(editor.getServicesRegistry().getService(ModelSet.class)).getResource().getContents().get(1); + + final IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class); + + // Check initial state + int availablePages = pageManager.allPages().size(); + + TransactionalEditingDomain editingDomain = editor.getServicesRegistry().getService(TransactionalEditingDomain.class); + + CompoundCommand command = new CompoundCommand("Delete diagram"); + + Command sashRemoveComd = new RecordingCommand(editingDomain, "Remove page") { + + @Override + protected void doExecute() { + pageManager.closeAllOpenedPages(diagram); + } + + }; + + command.append(sashRemoveComd); + command.append(new GMFtoEMFCommandWrapper(new DestroyElementPapyrusCommand(new DestroyElementRequest(diagram, false)))); + + editingDomain.getCommandStack().execute(command); + + Assert.assertEquals("The page has not been correctly removed", availablePages - 1, pageManager.allPages().size()); + Assert.assertNull("The diagram should not be contained in the resource anymore", diagram.eResource()); + } + + @Override + protected String getSourcePath() { + return SOURCE_PATH; + } +} diff --git a/tests/junit/plugins/editor/pom.xml b/tests/junit/plugins/editor/pom.xml new file mode 100755 index 00000000000..079e2454f48 --- /dev/null +++ b/tests/junit/plugins/editor/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + pom + + org.eclipse.papyrus.tests + org.eclipse.papyrus.plugins.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.editor.tests.releng + 0.0.1-SNAPSHOT + Tests for the Eclipse Editors contributions of Papyrus + + + org.eclipse.papyrus.eclipse.project.editors.tests + org.eclipse.papyrus.editor.integration.tests + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.classpath b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.classpath new file mode 100755 index 00000000000..eca7bdba8f0 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.project b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.project new file mode 100755 index 00000000000..d7e9bd1f78e --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.infra.core.clipboard.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/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.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/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100755 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/.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/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/ClipboardTests.launch b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/ClipboardTests.launch new file mode 100755 index 00000000000..a2ba00d6405 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/ClipboardTests.launch @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/META-INF/MANIFEST.MF new file mode 100755 index 00000000000..359924c7d8c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/META-INF/MANIFEST.MF @@ -0,0 +1,17 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui;bundle-version="3.107.0", + org.eclipse.core.runtime;bundle-version="3.11.0", + org.junit, + org.eclipse.papyrus.junit.framework;bundle-version="1.2.0", + org.eclipse.papyrus.junit.utils;bundle-version="2.0.100", + org.eclipse.papyrus.infra.core;bundle-version="[2.2.0,3.0.0)" +Export-Package: org.eclipse.papyrus.infra.core.clipboard.tests +Bundle-Vendor: %Bundle-Vendor +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.3.0.qualifier +Bundle-Name: %Bundle-Name +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.infra.core.clipboard.tests.Activator +Bundle-SymbolicName: org.eclipse.papyrus.infra.core.clipboard.tests;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/about.html b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/about.html new file mode 100755 index 00000000000..dd3c089a94c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/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/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/build.properties b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/build.properties new file mode 100644 index 00000000000..f4bd95dd18e --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/build.properties @@ -0,0 +1,20 @@ +# +# Copyright (c) 2015, 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: +# CEA List - Initial API and implementation +# Christian W. Damus - bug 502461 +# +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.properties,\ + plugin.xml +src.includes = about.html diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.properties b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.properties new file mode 100755 index 00000000000..4a5eeecce71 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.properties @@ -0,0 +1,3 @@ +#Properties file for org.eclipse.papyrus.infra.core.clipboard.tests +Bundle-Vendor = Eclipse Modeling Project +Bundle-Name = Clipboard Tests \ No newline at end of file diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.xml b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.xml new file mode 100644 index 00000000000..499607a6c58 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/plugin.xml @@ -0,0 +1,23 @@ + + + + + + + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/pom.xml b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/pom.xml new file mode 100755 index 00000000000..64146022501 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + + org.eclipse.papyrus + org.eclipse.papyrus.tests.releng + 1.2.0-SNAPSHOT + ../../../../../../releng/main-tests + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.core.clipboard.tests + 1.3.0-SNAPSHOT + eclipse-test-plugin + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AWTClipboardUtils.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AWTClipboardUtils.java new file mode 100755 index 00000000000..222bcfbb536 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AWTClipboardUtils.java @@ -0,0 +1,45 @@ +/***************************************************************************** + * 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.infra.core.clipboard.tests; + +import java.awt.Toolkit; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.StringSelection; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.io.IOException; + +public class AWTClipboardUtils { + + static void fillClipboard(String str) { + // its seems that the clipboard must be filled with the same way than we read it! + java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + + // if (clipboard.isDataFlavorAvailable(DataFlavor.stringFlavor)) { + StringSelection s = new StringSelection(str); + clipboard.setContents(s, s); + // } + } + + static String getClipboardContents() throws UnsupportedFlavorException, IOException { + String bufferSystem = null; + + + java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + + if (clipboard.isDataFlavorAvailable(DataFlavor.stringFlavor)) { + bufferSystem = clipboard.getData(DataFlavor.stringFlavor).toString(); + } + return bufferSystem; + + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/Activator.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/Activator.java new file mode 100755 index 00000000000..b47db9d61cd --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/Activator.java @@ -0,0 +1,63 @@ +/***************************************************************************** + * 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.infra.core.clipboard.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.infra.core.clipboard.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/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AllTests.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AllTests.java new file mode 100644 index 00000000000..1a6091a0012 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/AllTests.java @@ -0,0 +1,28 @@ +/***************************************************************************** + * Copyright (c) 2015, 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: + * CEA LIST - Initial API and implementation + * Christian W. Damus - bug 502461 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.clipboard.tests; + +import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; +import org.junit.runner.RunWith; +import org.junit.runners.Suite.SuiteClasses; + +@RunWith(ClassificationSuite.class) +@SuiteClasses({ + ClipboardTests.class, + CopierFactoryTest.class, +}) +public class AllTests { + // JUnit 4 test suite + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/ClipboardTests.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/ClipboardTests.java new file mode 100755 index 00000000000..06b1381bbdf --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/ClipboardTests.java @@ -0,0 +1,86 @@ +/***************************************************************************** + * 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: + * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.clipboard.tests; + +import java.awt.datatransfer.UnsupportedFlavorException; +import java.io.IOException; + +import org.eclipse.papyrus.junit.framework.classification.FailingTest; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.junit.Assert; +import org.junit.Test; + + +/** + * + * @author Vincent Lorenzo + * This tests classes tests provides clipboard reading and wrintg tests into the clipboard + */ +public class ClipboardTests extends AbstractPapyrusTest{ + + /** + * the string used to fill the clipboard. We don't use \n or \r\n, because it seems me than the implements AWT/SWT changes them and it is not the goal of these tests + */ + public static final String CLIPBOARD_CONTENTS = "Class1\tClass2_Class3\tClass4"; //$NON-NLS-1$ + + + @Test + public void fillSWT_readSWT() { + StringBuffer testedString = new StringBuffer(CLIPBOARD_CONTENTS); + testedString.append("test1"); //$NON-NLS-1$ + SWTClipboardUtils.fillClipboard(testedString.toString()); + String read = SWTClipboardUtils.getClipboardContents(); + Assert.assertNotNull(read); + Assert.assertEquals(testedString.toString(), read); + } + + /** + * 467554: filling clipboard with SWT and reading it with AWT doesn't work on Linux + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=467554 + * + * @throws UnsupportedFlavorException + * @throws IOException + */ + @FailingTest + @Test + public void fillSWT_readAWT() throws UnsupportedFlavorException, IOException { + StringBuffer testedString = new StringBuffer(CLIPBOARD_CONTENTS); + testedString.append("test2"); //$NON-NLS-1$ + SWTClipboardUtils.fillClipboard(testedString.toString()); + String read = AWTClipboardUtils.getClipboardContents(); + Assert.assertNotNull(read); + Assert.assertEquals(testedString.toString(), read); + } + + @Test + public void fillAWT_readAWT() throws UnsupportedFlavorException, IOException { + StringBuffer testedString = new StringBuffer(CLIPBOARD_CONTENTS); + testedString.append("test3"); //$NON-NLS-1$ + AWTClipboardUtils.fillClipboard(testedString.toString()); + String read = AWTClipboardUtils.getClipboardContents(); + Assert.assertNotNull(read); + Assert.assertEquals(testedString.toString(), read); + } + + @Test + public void fillAWT_readSWT() { + StringBuffer testedString = new StringBuffer(CLIPBOARD_CONTENTS); + testedString.append("test4"); //$NON-NLS-1$ + AWTClipboardUtils.fillClipboard(testedString.toString()); + String read = SWTClipboardUtils.getClipboardContents(); + Assert.assertNotNull(read); + Assert.assertEquals(testedString.toString(), read); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/CopierFactoryTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/CopierFactoryTest.java new file mode 100644 index 00000000000..08241e954ab --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/CopierFactoryTest.java @@ -0,0 +1,185 @@ +/***************************************************************************** + * 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.infra.core.clipboard.tests; + +import static org.eclipse.papyrus.junit.matchers.MoreMatchers.greaterThan; +import static org.eclipse.papyrus.junit.matchers.MoreMatchers.isEmpty; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.CoreMatchers.sameInstance; +import static org.hamcrest.MatcherAssert.assertThat; + +import org.eclipse.emf.ecore.EAnnotation; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.EReference; +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.clipboard.ICopierFactory; +import org.eclipse.papyrus.infra.core.clipboard.ICopierFactory.Configuration; +import org.eclipse.papyrus.infra.core.internal.clipboard.CopierFactory; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestRule; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; + +/** + * Test cases for the {@link CopierFactory} class. + */ +@SuppressWarnings("restriction") +public class CopierFactoryTest { + + @Rule + public final TestRule configRule = TestConfigurator.rule(); + + /** + * Initializes me. + */ + public CopierFactoryTest() { + super(); + } + + /** + * Tests the factory with the default copy behaviour. + */ + @Test + public void defaultCopierFactory() { + EClass original = createTestModel(); + + EcoreUtil.Copier copier = ICopierFactory.getInstance(null).get(); + EClass copy = copy(original, copier); + + // Check that we have the copy we expect + assertThat(copy, not(sameInstance(original))); + assertThat(copy.getName(), is(original.getName())); + assertThat(copy.getEReferences().size(), is(2)); + + // And that the correct filtering was applied + copy.getEReferences().forEach(ref -> assertThat(ref.getEOpposite(), nullValue())); + + // Not this + assertThat(copy.getEReferences().stream().flatMap(ref -> ref.getEAnnotations().stream()) + .peek(a -> assertThat(a.getReferences(), not(isEmpty()))) + .count(), greaterThan(0L)); // In fact we have tested at least one + } + + /** + * Tests the factory with non-default copy behaviour to verify that + * configurators see the correct options in in the configuration. + */ + @Test + public void oneOffCopierFactory() { + EClass original = createTestModel(); + + EcoreUtil.Copier copier = ICopierFactory.getInstance(null, false).get(); + EClass copy = copy(original, copier); + + // Check that we have the copy we expect + assertThat(copy, not(sameInstance(original))); + assertThat(copy.getName(), is(original.getName())); + assertThat(copy.getEReferences().size(), is(2)); + + // And that the correct filtering was applied + assertThat(copy.getEReferences().stream().flatMap(ref -> ref.getEAnnotations().stream()) + .peek(a -> assertThat(a.getReferences(), isEmpty())) + .count(), greaterThan(0L)); // In fact we have tested at least one + + // Not this + copy.getEReferences().forEach(ref -> assertThat(ref.getEOpposite(), notNullValue())); + } + + // + // Test framework + // + + EClass createTestModel() { + EClass result = EcoreFactory.eINSTANCE.createEClass(); + result.setName("Test"); + + EReference r1 = EcoreFactory.eINSTANCE.createEReference(); + r1.setName("r1"); + result.getEStructuralFeatures().add(r1); + + EReference r2 = EcoreFactory.eINSTANCE.createEReference(); + r2.setName("r2"); + result.getEStructuralFeatures().add(r2); + + r2.setEOpposite(r1); + r1.setEOpposite(r2); + + EOperation o1 = EcoreFactory.eINSTANCE.createEOperation(); + o1.setName("o1"); + result.getEOperations().add(o1); + + EAnnotation annotation = EcoreFactory.eINSTANCE.createEAnnotation(); + annotation.setSource("test"); + r1.getEAnnotations().add(annotation); + annotation.getReferences().add(o1); + + return result; + } + + T copy(T original, EcoreUtil.Copier copier) { + @SuppressWarnings("unchecked") + T result = (T) copier.copy(original); + copier.copyReferences(); + return result; + } + + // + // Nested types + // + + public static final class TestConfigurator implements ICopierFactory.Configurator { + static boolean isEnabled; + + @Override + public void configureCopier(Configuration copierConfiguration) { + if (isEnabled) { + if (copierConfiguration.isUseOriginalReferences()) { + filter(copierConfiguration, EcorePackage.Literals.EREFERENCE__EOPPOSITE); + } else { + filter(copierConfiguration, EcorePackage.Literals.EANNOTATION__REFERENCES); + } + } + } + + void filter(Configuration copierConfig, EReference reference, EClass ownerType) { + copierConfig.filterReferences((ref, owner) -> (ref == reference) && ownerType.isInstance(owner)); + } + + void filter(Configuration copierConfig, EReference reference) { + filter(copierConfig, reference, reference.getEContainingClass()); + } + + static TestRule rule() { + return new TestWatcher() { + @Override + protected void starting(Description description) { + isEnabled = true; + } + + @Override + protected void finished(Description description) { + isEnabled = false; + } + }; + } + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/SWTClipboardUtils.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/SWTClipboardUtils.java new file mode 100755 index 00000000000..d07f10965b7 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.clipboard.tests/src/org/eclipse/papyrus/infra/core/clipboard/tests/SWTClipboardUtils.java @@ -0,0 +1,53 @@ +/***************************************************************************** + * 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.infra.core.clipboard.tests; + +import org.eclipse.swt.dnd.Clipboard; +import org.eclipse.swt.dnd.TextTransfer; +import org.eclipse.swt.dnd.Transfer; +import org.eclipse.swt.widgets.Display; + +public class SWTClipboardUtils { + + static void fillClipboard(String str) { + // adapted from CopyDataToClipboard from nattable + final TextTransfer textTransfer = TextTransfer.getInstance(); + final Clipboard clipboard = new Clipboard(Display.getDefault()); + try { + clipboard.setContents(new Object[] { str.toString() }, + new Transfer[] { textTransfer }); + } finally { + clipboard.dispose(); + } + + } + + static String getClipboardContents() { + // using SWT + final Display display = Display.getDefault(); + String contents = null; + final Clipboard clipboard = new Clipboard(display); + try { + + // we use the text transfert + final TextTransfer transfer = TextTransfer.getInstance(); + + contents = (String) clipboard.getContents(transfer); + + return contents; + } finally { + clipboard.dispose(); + } + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.classpath b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.classpath new file mode 100644 index 00000000000..969b4034060 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.project b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.project new file mode 100644 index 00000000000..2cee6e820ee --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.infra.core.sasheditor.di.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/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c585cc455ae --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.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.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 +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/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/.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/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..d1aa705cee3 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Require-Bundle: org.junit;bundle-version="4.10.0", + org.eclipse.papyrus.junit.framework;bundle-version="1.2.0", + org.eclipse.emf.ecore.xmi;bundle-version="[2.12.0,3.0.0)", + org.eclipse.papyrus.infra.core.sasheditor.di;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.sasheditor.tests;bundle-version="1.2.0" +Export-Package: org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider, + org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal, + org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query, + org.eclipse.papyrus.infra.core.sasheditor.di.tests +Bundle-Vendor: %Bundle-Vendor +Bundle-Version: 1.2.0.qualifier +Bundle-Name: %Bundle-Name +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.infra.core.sasheditor.di.tests;singleton:=true +Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/OSGI-INF/l10n/bundle.properties b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/OSGI-INF/l10n/bundle.properties new file mode 100644 index 00000000000..bb13940c6b9 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,3 @@ +#Properties file for org.eclipse.papyrus.infra.core.sasheditor.di.tests +Bundle-Vendor = Eclipse Modeling Project +Bundle-Name = Test fragment for org.eclipse.papyrus.infra.core.sasheditor.di plugin \ No newline at end of file diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/about.html b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/about.html new file mode 100644 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/about.html @@ -0,0 +1,28 @@ + + + + +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/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/build.properties b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/build.properties new file mode 100644 index 00000000000..e67a45af40f --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/build.properties @@ -0,0 +1,6 @@ +source.. = test/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + OSGI-INF/ diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/org.eclipse.papyrus.sasheditor.di.tests.launch b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/org.eclipse.papyrus.sasheditor.di.tests.launch new file mode 100644 index 00000000000..52d272a6ffc --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/org.eclipse.papyrus.sasheditor.di.tests.launch @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/pom.xml b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/pom.xml new file mode 100644 index 00000000000..b02007732e7 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + + org.eclipse.papyrus + org.eclipse.papyrus.tests.releng + 1.2.0-SNAPSHOT + ../../../../../../releng/main-tests + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.core.sasheditor.di.tests + 1.2.0-SNAPSHOT + eclipse-test-plugin + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/DiSashModelMngrTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/DiSashModelMngrTest.java new file mode 100644 index 00000000000..56015a2d975 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/DiSashModelMngrTest.java @@ -0,0 +1,201 @@ +/***************************************************************************** + * Copyright (c) 2009, 2016 CEA LIST, LIFL, 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: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * Christian W. Damus - bug 485220 + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider; + +import static org.junit.Assert.assertNotNull; + +import java.io.File; + +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.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashWindowsMngr; +import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + + +/** + * @author cedric dumoulin + */ +public class DiSashModelMngrTest extends AbstractPapyrusTest { + + /** + * A fake factory for testing. + */ + protected IPageModelFactory fakeModelFactory; + + /** + * @see junit.framework.TestCase#setUp() + * + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + fakeModelFactory = new FakeModelFactory(); + } + + /** + * @see junit.framework.TestCase#tearDown() + * + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + // Nothing + } + + protected Resource createDiSashModelResource() { + // Create di resource + ResourceSet resourceSet = new ResourceSetImpl(); + + // Register the default resource factory -- only needed for stand-alone! + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); + + // Get the URI of the model file. + URI fileURI = URI.createFileURI(new File("tempfile.di").getAbsolutePath()); + + Resource diResource = resourceSet.createResource(fileURI); + return diResource; + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelMngr#DiSashModelMngr(org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory)} + * . + */ + @Test + public void testDiSashModelMngrIPageModelFactory() { + + MyDISashModelMngr modelMngr = new MyDISashModelMngr(fakeModelFactory); + + assertNotNull("retrieve ContentProvider", modelMngr.getISashWindowsContentProvider()); + assertNotNull("retrieve PageMngr", modelMngr.getIPageMngr()); + assertNotNull("model created", modelMngr.getDiSashWindowsMngr()); + assertNotNull("default folder is set", modelMngr.getDiSashWindowsMngr().getSashModel().getCurrentSelection()); + // + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelMngr#DiSashModelMngr(org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory, org.eclipse.emf.ecore.resource.Resource)} + * . + */ + @Test + public void testDiSashModelMngrIPageModelFactoryResource() { + Resource resource = createDiSashModelResource(); + + MyDISashModelMngr modelMngr = new MyDISashModelMngr(fakeModelFactory, resource); + + assertNotNull("retrieve ContentProvider", modelMngr.getISashWindowsContentProvider()); + assertNotNull("retrieve PageMngr", modelMngr.getIPageMngr()); + assertNotNull("model created", modelMngr.getDiSashWindowsMngr()); + assertNotNull("default folder is set", modelMngr.getDiSashWindowsMngr().getSashModel().getCurrentSelection()); + assertNotNull("event provider is created", modelMngr.getSashModelContentChangedProvider()); + // Check resource + + assertNotNull("model attached to resource", lookupSashModel(resource)); + + } + + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelMngr#DiSashModelMngr(org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory, org.eclipse.papyrus.sashwindows.di.DiSashModel)} + * . + */ + @Test + public void testDiSashModelMngrIPageModelFactoryDiSashModel() { + SashWindowsMngr diSashModel = DiUtils.createDefaultSashWindowsMngr(); + + MyDISashModelMngr modelMngr = new MyDISashModelMngr(fakeModelFactory, diSashModel); + + assertNotNull("retrieve ContentProvider", modelMngr.getISashWindowsContentProvider()); + assertNotNull("retrieve PageMngr", modelMngr.getIPageMngr()); + assertNotNull("model created", modelMngr.getDiSashWindowsMngr()); + assertNotNull("default folder is set", modelMngr.getDiSashWindowsMngr().getSashModel().getCurrentSelection()); + assertNotNull("event provider is created", modelMngr.getSashModelContentChangedProvider()); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelMngr#getIPageMngr()}. + */ + @Test + public void testGetIPageMngr() { + MyDISashModelMngr modelMngr = new MyDISashModelMngr(fakeModelFactory); + + assertNotNull("retrieve PageMngr", modelMngr.getIPageMngr()); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelMngr#getISashWindowsContentProvider()}. + */ + @Test + public void testGetISashWindowsContentProvider() { + MyDISashModelMngr modelMngr = new MyDISashModelMngr(fakeModelFactory); + + assertNotNull("retrieve ContentProvider", modelMngr.getISashWindowsContentProvider()); + } + + /** + * Lookup for the SashModel object in the resource + * + * @param diResource + * @return + */ + private SashWindowsMngr lookupSashModel(Resource diResource) { + + return DiUtils.lookupSashWindowsMngr(diResource); + } + + // + // Nested types + // + + static class MyDISashModelMngr extends DiSashModelMngr { + + MyDISashModelMngr(IPageModelFactory pageModelFactory, boolean createDefaultSashModel) { + super(pageModelFactory, createDefaultSashModel); + } + + MyDISashModelMngr(IPageModelFactory pageModelFactory, Resource diResource) { + super(pageModelFactory, diResource); + } + + MyDISashModelMngr(IPageModelFactory pageModelFactory, SashWindowsMngr sashModel) { + super(pageModelFactory, sashModel); + } + + MyDISashModelMngr(IPageModelFactory pageModelFactory) { + super(pageModelFactory); + } + + // Overridden to make it accessible + @Override + protected SashWindowsMngr getDiSashWindowsMngr() { + return super.getDiSashWindowsMngr(); + } + + // Overridden to make it accessible + @Override + protected SashWindowsMngr lookupSashWindowMngr(Resource diResource) { + return super.lookupSashWindowMngr(diResource); + } + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/FakeModelFactory.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/FakeModelFactory.java new file mode 100644 index 00000000000..b842c17a7aa --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/FakeModelFactory.java @@ -0,0 +1,36 @@ +/***************************************************************************** + * Copyright (c) 2009 CEA LIST & LIFL + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; + + +/** + * @author dumoulin + */ +public class FakeModelFactory implements IPageModelFactory { + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory#createIPageModel(org.eclipse.emf.ecore.EObject) + * + * @param pageIdentifier + * @return + */ + public IPageModel createIPageModel(Object pageIdentifier) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/AbstractDiContentProviderTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/AbstractDiContentProviderTest.java new file mode 100644 index 00000000000..3433a910f52 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/AbstractDiContentProviderTest.java @@ -0,0 +1,394 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; + +import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.folder; +import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.hSash; +import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.page; +import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.vSash; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder; +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash; +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryExp; +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page; +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.QueryException; +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery; +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; +import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.eclipse.swt.SWT; +import org.junit.Test; + +/** + * Common ancestor for transactional and non transactional tests. + * + * @author cedric dumoulin + * + */ +public abstract class AbstractDiContentProviderTest extends AbstractPapyrusTest { + + /** + * The {@link DiContentProvider} under test. + */ + protected DiContentProvider diContentProvider; + + /** + * The {@link DiContentProvider} under test. + */ + protected ISashWindowsContentProvider contentProvider; + + /** + * ModelQuery used to query SashModel. + */ + protected SashModelQuery modelQuery; + + + /** + * Create the specified model in the SashModel. + * Concrete implementation should call {@link SashModelQuery}, and surround call + * with transaction if needed. + * + * + * @param query + */ + protected abstract void createModel(IQueryExp query) throws QueryException; + + /** + * Test if the model can be modofied. + * + * @throws QueryException + */ + @Test + public void testModelIsWritable() throws QueryException { + + // Try to create a model + IQueryExp query = folder("a", page(), page()); + createModel(query); + // Check creation + modelQuery.assertConform(query); + + // Other query + // Other query + query = new HSash(new Folder(new Page(), new Page("p1")), new Folder("a", new Page())); + createModel(query); + + // Check creation + modelQuery.assertConform(query); + Map result = modelQuery.queryModel(query); + assertNotNull("folder found", result.get("a")); + assertTrue("right type", result.get("a") instanceof TabFolder); + assertNotNull("page found", result.get("p1")); + assertTrue("right type", result.get("p1") instanceof PageRef); + + // ********************* + // Other query + query = hSash(folder(page(), page()), vSash("s2", folder(page()), folder(page()))); + createModel(query); + + // Check creation + modelQuery.assertConform(query); + result = modelQuery.queryModel(query); + + } + + /** + * Test tab close from a folder with more than one tab + * + * @throws QueryException + */ + @Test + public void testClosePage() throws QueryException { + + // Create a folder with several page + IQueryExp query = folder("f1", page("p1"), page("p2"), page("p3")); + createModel(query); + // Check creation + modelQuery.assertConform(query); + + // get models (from diModels, and factory for sashModel) + Map modelElements = modelQuery.queryModel(query); + SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); + + // do action : Close a page + contentProvider.removePage(sashModels.getFolder("f1"), 1); + + // check result + IQueryExp expectedModel = folder("f1", page("p1"), page("p3")); + modelQuery.assertConform(expectedModel); + + } + + /** + * Test tab close from a folder with only one tab. Some other folder + * exist + * + * @throws QueryException + */ + @Test + public void testCloseLastTab() throws QueryException { + // Create a folder with several page + IQueryExp query = hSash(folder("f1", page("p1"), page("p2"), page("p3")), folder("f2", page("p4"))); + createModel(query); + // Check creation + modelQuery.assertConform(query); + + // get models (from diModels, and factory for sashModel) + Map modelElements = modelQuery.queryModel(query); + SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); + + // do action : Close a page + contentProvider.removePage(sashModels.getFolder("f2"), 0); + + // check result + IQueryExp expectedModel = folder("f1", page("p1"), page("p2"), page("p3")); + modelQuery.assertConform(expectedModel); + + + } + + /** + * Test tab close from the last folder with only one tab. No more folder + * exists. + * + * @throws QueryException + * + */ + @Test + public void testCloseLastTabFromLastFolder() throws QueryException { + + // Create a folder with several page + IQueryExp query = folder("f1", page("p1")); + createModel(query); + // Check creation + modelQuery.assertConform(query); + + // get models (from diModels, and factory for sashModel) + Map modelElements = modelQuery.queryModel(query); + SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); + + // do action : Close a page + contentProvider.removePage(sashModels.getFolder("f1"), 0); + + // check result + IQueryExp expectedModel = folder("f1"); + modelQuery.assertConform(expectedModel); + } + + /** + * Test moving a page inside the same folder + * + * @throws QueryException + */ + @Test + public void testMovePageInsideFolder() throws QueryException { + + // Create a folder with several page + IQueryExp query = folder("f1", page("p1"), page("p2"), page("p3")); + createModel(query); + // Check creation + modelQuery.assertConform(query); + + // get models (from diModels, and factory for sashModel) + Map modelElements = modelQuery.queryModel(query); + SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); + + // do action : move a page + contentProvider.movePage(sashModels.getFolder("f1"), 1, 0); + + // check result + IQueryExp expectedModel = folder("f1", page("p2"), page("p1"), page("p3")); + modelQuery.assertConform(expectedModel); + + // do action : move a page + contentProvider.movePage(sashModels.getFolder("f1"), 0, 2); + + // check result + expectedModel = folder("f1", page("p1"), page("p3"), page("p2")); + modelQuery.assertConform(expectedModel); + + // do action : move a page + contentProvider.movePage(sashModels.getFolder("f1"), 2, 0); + + // check result + expectedModel = folder("f1", page("p2"), page("p1"), page("p3")); + modelQuery.assertConform(expectedModel); + } + + /** + * Test moving a page from folder to folder + * + * @throws QueryException + */ + @Test + public void testMovePageBetweenFolder() throws QueryException { + + // Create a folder with several page + IQueryExp query = hSash(folder("f1", page("p1"), page("p2"), page("p3")), folder("f2", page("p4"))); + createModel(query); + // Check creation + modelQuery.assertConform(query); + + // get models (from diModels, and factory for sashModel) + Map modelElements = modelQuery.queryModel(query); + SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); + + // do action : move a page + contentProvider.movePage(sashModels.getFolder("f1"), 1, sashModels.getFolder("f2"), 0); + + // check result + IQueryExp expectedModel = hSash(folder("f1", page("p1"), page("p3")), folder("f2", page("p2"), page("p4"))); + modelQuery.assertConform(expectedModel); + + // do action : move a page + contentProvider.movePage(sashModels.getFolder("f1"), 1, sashModels.getFolder("f2"), 1); + + // check result + expectedModel = hSash(folder("f1", page("p1")), folder("f2", page("p2"), page("p3"), page("p4"))); + modelQuery.assertConform(expectedModel); + + // do action : move a page, drop in target page (targetIndex == -1 + contentProvider.movePage(sashModels.getFolder("f2"), 0, sashModels.getFolder("f1"), -1); + + // check result + expectedModel = hSash(folder("f1", page("p1"), page("p2")), folder("f2", page("p3"), page("p4"))); + modelQuery.assertConform(expectedModel); + + } + + /** + * Test tab close from a folder with more than one tab + * + * @throws QueryException + */ + @Test + public void testCreateFolder() throws QueryException { + + // Create a folder with several page + IQueryExp query = folder("f1", page("p1"), page("p2"), page("p3")); + createModel(query); + // Check creation + modelQuery.assertConform(query); + + // get models (from diModels, and factory for sashModel) + Map modelElements = modelQuery.queryModel(query); + SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); + + // do action : create a folder + contentProvider.createFolder(sashModels.getFolder("f1"), 1, sashModels.getFolder("f1"), SWT.RIGHT); + + // check result + IQueryExp expectedModel = hSash(folder("f1", page("p1"), page("p3")), folder(page("p2"))); + modelQuery.assertConform(expectedModel); + + // do action : create a folder + contentProvider.createFolder(sashModels.getFolder("f1"), 0, sashModels.getFolder("f1"), SWT.UP); + + // check result + expectedModel = hSash(vSash(folder(page("p1")), folder("f1", page("p3"))), folder(page("p2"))); + modelQuery.assertConform(expectedModel); + + } + + /** + * Test moving a folder around another folder + * + * @throws QueryException + */ + @Test + public void testMoveFolderAroundFolder() throws QueryException { + + // Create a folder with several page + IQueryExp query = hSash(folder("f1", page("p1"), page("p2"), page("p3")), folder("f2", page("p4"), page("p5"))); + createModel(query); + // Check creation + modelQuery.assertConform(query); + + // get models (from diModels, and factory for sashModel) + Map modelElements = modelQuery.queryModel(query); + SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); + + // do action : move a folder + // -1 mean all pages + contentProvider.createFolder(sashModels.getFolder("f2"), -1, sashModels.getFolder("f1"), SWT.UP); + + // check result + IQueryExp expectedModel = vSash(folder(page("p4"), page("p5")), folder("f1", page("p1"), page("p2"), page("p3"))); + modelQuery.assertConform(expectedModel); + + } + + /** + * Test moving a folder inside another folder + * + * @throws QueryException + */ + @Test + public void testMoveFolderInsideFolder() throws QueryException { + + // Create a folder with several page + IQueryExp query = hSash(folder("f1", page("p1"), page("p2"), page("p3")), folder("f2", page("p4"), page("p5"))); + createModel(query); + // Check creation + modelQuery.assertConform(query); + + // get models (from diModels, and factory for sashModel) + Map modelElements = modelQuery.queryModel(query); + SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); + + // do action : move a folder. In fact, move all the pages + // -1 mean all pages + contentProvider.movePage(sashModels.getFolder("f2"), -1, sashModels.getFolder("f1"), -1); + + // check result + IQueryExp expectedModel = folder("f1", page("p1"), page("p2"), page("p3"), page("p4"), page("p5")); + modelQuery.assertConform(expectedModel); + + } + + /** + * Test moving a folder inside another folder + * + * @throws QueryException + */ + @Test + public void testMoveFolderInsideFolderAtSpecifiedIndex() throws QueryException { + + // Create a folder with several page + IQueryExp query = hSash(folder("f1", page("p1"), page("p2"), page("p3")), folder("f2", page("p4"), page("p5"))); + createModel(query); + // Check creation + modelQuery.assertConform(query); + + // get models (from diModels, and factory for sashModel) + Map modelElements = modelQuery.queryModel(query); + SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); + + // do action : move a folder. In fact, move all the pages + // -1 mean all pages + contentProvider.movePage(sashModels.getFolder("f2"), -1, sashModels.getFolder("f1"), 0); + + // check result + IQueryExp expectedModel = folder("f1", page("p4"), page("p5"), page("p1"), page("p2"), page("p3")); + modelQuery.assertConform(expectedModel); + + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CheckVisitor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CheckVisitor.java new file mode 100644 index 00000000000..a96170a69c0 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CheckVisitor.java @@ -0,0 +1,119 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; + +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NoMatchException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; +import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; +import org.eclipse.papyrus.infra.core.sashwindows.di.Window; +import org.eclipse.swt.SWT; + + +/** + * @author cedric dumoulin + * + */ +public class CheckVisitor extends DiContentProviderBaseVisitor implements IPagesModelVisitor { + + /** + * @return the isVisitingParentFirst + */ + @Override + public boolean isVisitingParentFirst() { + return false; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) + * + * @param windowTerm + * @param windowModel + */ + @Override + public void visit(WindowTerm windowTerm, Window windowModel) { + // TODO Auto-generated method stub + + } + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder) + * + * @param folder + */ + @Override + public void visit(Folder folder, TabFolder folderModel) { + // Check name + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash) + * + * @param sash + * @throws NoMatchException + */ + @Override + public void visit(HSash sash, SashPanel sashModel) throws NoMatchException { + // Check orientation + if( sashModel.getDirection() != SWT.HORIZONTAL) { + throw new NoMatchException( this.toString() + " - SashOrientation does not match 'HORIZONTAL'" ); + } + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash) + * + * @param sash + * @throws NoMatchException + */ + @Override + public void visit(VSash sash , SashPanel sashModel) throws NoMatchException { + // Check orientation + if( sashModel.getDirection() != SWT.VERTICAL) { + throw new NoMatchException( this.toString() + " - SashOrientation does not match 'VERTICAL'" ); + } + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page) + * + * @param page + * @throws NoMatchException + */ + @Override + public void visit(Page page, PageRef pageModel) throws PagesModelException { + //check name + if(page.getIdentifier() != null) { + checkName(page.getIdentifier(), pageModel.getPageIdentifier()) ; + } + else if(page.getName() != null) { + checkName(page.getName(), pageModel.getPageIdentifier()) ; + } + } + + + protected void checkName( Object expectedName, Object foundName) throws NoMatchException { + if( expectedName != foundName ) + throw new NoMatchException( "Names do not match (expected=" + + expectedName + ", found="+ foundName ); + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/ContentChangeListener.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/ContentChangeListener.java new file mode 100644 index 00000000000..754a2546064 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/ContentChangeListener.java @@ -0,0 +1,43 @@ +/***************************************************************************** + * Copyright (c) 2009 CEA LIST & LIFL + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IContentChangedListener; + +/** + * Listener on ContentChange for Tests. + * + * @author dumoulin + */ +public class ContentChangeListener implements IContentChangedListener { + + /** Count number of change event */ + private int changeCount = 0; + + /** + * @return the changeCount + */ + public int getChangeCount() { + return changeCount; + } + + public void contentChanged(ContentEvent event) { + changeCount++; + } + + public void reset() { + changeCount = 0; + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CreateModelVisitor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CreateModelVisitor.java new file mode 100644 index 00000000000..85034df40fd --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/CreateModelVisitor.java @@ -0,0 +1,147 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; + +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.AbstractSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PanelTerm; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; +import org.eclipse.papyrus.infra.core.sashwindows.di.DiFactory; +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; +import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; +import org.eclipse.papyrus.infra.core.sashwindows.di.Window; +import org.eclipse.swt.SWT; + +/** + * This visitor is used with {@link IQueryTerm} to create a {@link SashModel} instancied + * with the Sash, folders and pages specified in the query. + * + * + * @author cedric dumoulin + * + */ +public class CreateModelVisitor extends DiContentProviderBaseVisitor implements IPagesModelVisitor { + + /** + * @return the isVisitingParentFirst + */ + public boolean isVisitingParentFirst() { + return true; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) + * + * @param windowTerm + * @param windowModel + */ + public void visit(WindowTerm windowTerm, Window windowModel) { + // Create children of the sash + PanelTerm panel = windowTerm.getPanel(); + if(panel instanceof AbstractSash) { + windowModel.setPanel(DiFactory.eINSTANCE.createSashPanel()); + } + else if (panel instanceof Folder) { + windowModel.setPanel(DiFactory.eINSTANCE.createTabFolder()); + } + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder, org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder) + * + * @param folder + * @param folderModel + */ + public void visit(Folder folder, TabFolder folderModel) { + + // Create children of the folder + for( Page page : folder.getPages() ) { + folderModel.getChildren().add(DiFactory.eINSTANCE.createPageRef()); + } + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) + * + * @param sashQuery + * @param sashModel + */ + public void visit(HSash sashQuery, SashPanel sashModel) { + + // sash orientation + sashModel.setDirection(SWT.HORIZONTAL); + // Create children of the sash + + createPanelOrFolder(sashQuery.getLeftup(), sashModel); + createPanelOrFolder(sashQuery.getRightdown(), sashModel); + } + + /** + * @param sashModel + * @param panel + */ + private void createPanelOrFolder(PanelTerm panel, SashPanel parent ) { + if(panel instanceof AbstractSash) { + parent.getChildren().add(DiFactory.eINSTANCE.createSashPanel()); + } + else if (panel instanceof Folder) { + parent.getChildren().add(DiFactory.eINSTANCE.createTabFolder()); + } + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) + * + * @param sash + * @param sashModel + */ + public void visit(VSash sashQuery, SashPanel sashModel) { + // sash orientation + sashModel.setDirection(SWT.VERTICAL); + // Create children of the sash + createPanelOrFolder(sashQuery.getLeftup(), sashModel); + createPanelOrFolder(sashQuery.getRightdown(), sashModel); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page, org.eclipse.papyrus.infra.core.sashwindows.di.PageRef) + * + * @param page + * @param pageModel + */ + public void visit(Page page, PageRef pageModel) { + + + if(page.getIdentifier() != null) { + pageModel.setPageIdentifier(page.getIdentifier()); + } + else if(page.getName() != null) { + pageModel.setPageIdentifier(page.getName()); + } + else { + pageModel.setPageIdentifier(new Object()); + } + + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProvider2Test.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProvider2Test.java new file mode 100644 index 00000000000..d31b8cc26cb --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProvider2Test.java @@ -0,0 +1,67 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; + +import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory; +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryExp; +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.QueryException; +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; +import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils; +import org.junit.After; +import org.junit.Before; + +/** + * @author dumoulin + * + */ +public class DiContentProvider2Test extends AbstractDiContentProviderTest { + + /* + * + */ + @Before + public void setUp() throws Exception { + IPageModelFactory pageModelFactory = new FakePageModelFactory(); + SashModel diSashModel = DiUtils.createDefaultSashModel(); + diContentProvider = new DiContentProvider(diSashModel, pageModelFactory); + contentProvider = diContentProvider; + + // Create model query + modelQuery = new SashModelQuery(diSashModel); + } + + /** + * + * @see junit.framework.TestCase#tearDown() + * + * @throws Exception + */ + @After + public void tearDown() throws Exception { + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.AbstractDiContentProviderTest#createModel(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm) + * + * @param query + * @throws QueryException + */ + @Override + protected void createModel(IQueryExp query) throws QueryException { + modelQuery.createModel(query); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderBaseVisitor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderBaseVisitor.java new file mode 100644 index 00000000000..83e0d2c000f --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderBaseVisitor.java @@ -0,0 +1,326 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; + +import java.util.Iterator; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NoMatchException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModel; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; +import org.eclipse.papyrus.infra.core.sashwindows.di.AbstractPanel; +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; +import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; +import org.eclipse.papyrus.infra.core.sashwindows.di.Window; + +/** + * A base implementation of {@link IPagesModelVisitor} to visit conjointly SashPagesModel and + * {@link DiContentProvider}. + * + * This implementation separate the navigation part (walk(term, contentProviderModel)) and + * the visit part (visit(term, contentProviderModel)). It implements the navigation part. + *
+ * The visit part should be implemented by subclasses. + * + * + * + * @author cedric dumoulin + * + */ +public class DiContentProviderBaseVisitor implements IPagesModelVisitor { + + /** + * @return the isVisitingParentFirst + */ + public boolean isVisitingParentFirst() { + return true; + } + + /** + * Visit the model. + * The second argument should be a SashModel, or one of its container (ex: DiContentProvider). + * + * @param pagesModel + * @param diPagesModel + * @throws PagesModelException + */ + public void walk(SashPagesModel pagesModel, Object diPagesModel) throws PagesModelException { + // Check associated model type + // It can be of different type: DiContentProvider or SashModel + // + SashModel sashModel = null; + if( diPagesModel instanceof SashModel) { + sashModel = (SashModel)diPagesModel; + } + else if(diPagesModel instanceof DiContentProvider) { + sashModel = ((DiContentProvider)diPagesModel).getDiSashModel(); + } + else { + throw new NoMatchException( "ContentProvider type ("+ diPagesModel.getClass().getName()+ ") does not match to SashModel or one of its container" ); + } + + + if( isVisitingParentFirst() ) { + visit(pagesModel, sashModel); + } + // visit children + for( WindowTerm windowTerm : pagesModel.getWindows() ) { + // Only one window + Window windowModel = sashModel.getWindows().get(0); + windowTerm.getPanel().accept(this, windowModel); + } + if( ! isVisitingParentFirst() ) { + visit(pagesModel, sashModel); + } + } + + /** + * Walk the WindowTerm and its child. + * @param windowTerm + * @param windowModel + * @throws PagesModelException + */ + public void walk(WindowTerm windowTerm, Object windowModel) throws PagesModelException { + // Check associated model type + if(! (windowModel instanceof Window) ) { + throw new NoMatchException( "ContentProvider type ("+ windowModel.getClass().getName()+ ") does not match to Window" ); + } + + Window window = (Window)windowModel; + + if( isVisitingParentFirst() ) { + visit(windowTerm, window); + } + // visit children + for( AbstractPanel panel : window.getChildren()) + windowTerm.getPanel().accept(this, panel); + + if( ! isVisitingParentFirst() ) { + visit(windowTerm, window); + } + } + + /** + * Walk folder and its children. + * + * @param folder + * @param folderModel + * @throws PagesModelException + */ + public void walk(Folder folder, Object model) throws PagesModelException { + // Check associated model type + if(! (model instanceof TabFolder) ) { + throw new NoMatchException( this.toString() + + "\n" + folder + + "\n - Model object type does not match to FolderQueryPart." + + " Expected TabFolder, found '" + model.getClass().getSimpleName() + "'." + + " (" + folder.getName() +")" ); + } + TabFolder folderModel = (TabFolder)model; + + // Visit this + if( isVisitingParentFirst() ) { + visit(folder, folderModel); + } + + // visit children + Iterator pageRefs = folderModel.getChildren().iterator(); + Iterator pageQueries = folder.getPages().iterator(); + while (pageRefs.hasNext() && pageQueries.hasNext() ) { + PageRef pageRef = pageRefs.next(); + Page query = pageQueries.next(); + + query.accept(this, pageRef); + } + if (pageRefs.hasNext()) { + // some page left + throw new NoMatchException( "Folder matching - " + + this.toString() + +" folder model have more pages than folder query. ("+folder.getName()+")" ); + } else if (pageQueries.hasNext() ) { + // some queries left + throw new NoMatchException( "Folder matching - " + + this.toString() + +" folder query have more page than folder model. ("+folder.getName()+")" ); + } + // Visit this + if( ! isVisitingParentFirst() ) { + visit(folder, folderModel); + } + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor#walk(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash, java.lang.Object) + * + * @param sash + * @param sashModel + * @throws PagesModelException + */ + public void walk(HSash sash, Object model) throws PagesModelException { + // Check associated model type + if(! (model instanceof SashPanel) ) { + throw new NoMatchException( this.toString() + " - Model object type does not match to SashPanel (found " + + model.getClass() + + " )"); + } + + SashPanel sashModel = (SashPanel)model; + +// // Check orientation +// if( sashModel.getDirection() != SWT.HORIZONTAL) { +// throw new NoMatchException( this.toString() + " - SashOrientation does not match 'HORIZONTAL'" ); +// } + // Visit this + if( isVisitingParentFirst() ) { + visit(sash, sashModel); + } + + // Visit children + sash.getLeftup().accept(this, sashModel.getChildren().get(0)); + sash.getRightdown().accept(this, sashModel.getChildren().get(1)); + + if( !isVisitingParentFirst() ) { + visit(sash, sashModel); + } + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor#walk(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash, java.lang.Object) + * + * @param sash + * @param sashModel + * @throws PagesModelException + */ + public void walk(VSash sash, Object model) throws PagesModelException { + // Check associated model type + if(! (model instanceof SashPanel) ) { + throw new NoMatchException( this.toString() + " - Model object type does not match to SashPanel (found " + + model.getClass() + + " )"); + } + + SashPanel sashModel = (SashPanel)model; + +// // Check orientation +// if( sashModel.getDirection() != SWT.VERTICAL) { +// throw new NoMatchException( this.toString() + " - SashOrientation does not match 'VERTICAL'" ); +// } + // Visit this + if( isVisitingParentFirst() ) { + visit(sash, sashModel); + } + + // Visit children + sash.getLeftup().accept(this, sashModel.getChildren().get(0)); + sash.getRightdown().accept(this, sashModel.getChildren().get(1)); + + if( !isVisitingParentFirst() ) { + visit(sash, sashModel); + } + } + + /** + * Walk the page. Simply call the corresponding {@link DiContentProviderBaseVisitor#visit(Page, IPageModel)} method. + * @param page + * @param pageModel + * @throws PagesModelException + */ + public void walk(Page page, Object model) throws PagesModelException { + // Check associated model type + if(! (model instanceof PageRef) ) { + throw new NoMatchException( this.toString() + " - Model object type does not match to PageRef" ); + } + PageRef pageModel = (PageRef)model; + visit(page, pageModel); + } + + + /** + * Visit the model. Actually, there is no counterpart for {@link SashPagesModel} in {@link SimpleContentProvider}. + * + * @param windowTerm + * @param windowModel + * @throws PagesModelException + */ + public void visit(SashPagesModel pagesModel, SashModel windowModel) throws PagesModelException { + + } + + /** + * Visit the corresponding node. + * To be implemented by subclass. + * + * + * @param windowTerm + * @param windowModel + */ + public void visit(WindowTerm windowTerm, Window windowModel) throws PagesModelException { + // To be implemented by subclass. + } + + /** + * Visit the corresponding node. + * To be implemented by subclass. + * + * @param folder + * @param folderModel + */ + public void visit(Folder folder, TabFolder folderModel) throws PagesModelException{ + + } + + /** + * Visit the corresponding node. + * To be implemented by subclass. + * + * @param sashQuery + * @param sashModel + */ + public void visit(HSash sashQuery, SashPanel sashModel) throws PagesModelException { + + } + + /** + * Visit the corresponding node. + * To be implemented by subclass. + * + * + * @param sash + * @param sashModel + */ + public void visit(VSash sashQuery, SashPanel sashModel) throws PagesModelException{ + } + + /** + * Visit the corresponding node. + * To be implemented by subclass. + * + * + * @param page + * @param pageModel + */ + public void visit(Page page, PageRef pageModel) throws PagesModelException { + + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacade.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacade.java new file mode 100644 index 00000000000..e330fe6e88b --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacade.java @@ -0,0 +1,441 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IAbstractPanelModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory; +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.QueryException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.BadNameException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NotFoundException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PanelTerm; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; +import org.eclipse.papyrus.infra.core.sashwindows.di.AbstractPanel; +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; +import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; +import org.eclipse.papyrus.infra.core.sashwindows.di.Window; +import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils; + +/** + * Class providing a facade to test the {@link SimpleSashWindowsContentProvider} class. + *
+ * This facade own a {@link DiContentProvider} and provides methods to manipulate it with + * the help of names. Each element in the {@link DiContentProvider} can be identified + * by a name (String). Then, the facade provide methods similar to {@link ISashWindowsContentProvider}, but using + * names rather than {@link IAbstractPanelModel} and {@link ITabFolderModel}. + *
+ * The facade maintains a mapping between the names and the {@link ISashWindowsContentProvider} models. + * + * @author cedric dumoulin + * + */ +public class DiContentProviderFacade implements ISashWindowsContentProviderFacade { + + /** + * The internal content provider this facade is for. + */ + protected DiContentProvider contentProvider; + + /** + * Mapping between names provided in the expressions and internal implementations of the {@link SashModel}. + * This mapping is maintained when elements are added or removed. + * + */ + protected Map namesMapping; + /** + * Cache used to maintain wrappers used to wrap internal SashModel object + * to {@link ISashWindowsContentProvider} model. + */ + protected Map contentProviderWrapperCache = new HashMap(); + + /** + * Constructor. + * Create a default internal {@link SimpleSashWindowsContentProvider}; + * @param modelMngr + */ + public DiContentProviderFacade() { + IPageModelFactory pageModelFactory = new FakePageModelFactory(); + SashModel diSashModel = DiUtils.createDefaultSashModel(); + this.contentProvider = new DiContentProvider(diSashModel, pageModelFactory); + } + + /** + * Constructor. + * + * @param modelMngr + */ + public DiContentProviderFacade(DiContentProvider contentProvider) { + this.contentProvider = contentProvider; + } + + /** + * @return the contentProvider + */ + public ISashWindowsContentProvider getIContentProvider() { + return contentProvider; + } + + + /** + * Reset the namesMapping context accordingly to the provided expr. + * A side effect is that the internal structure is checked against the expr. + *
+ * Reseting the names context allows to remove or add names to the context. + * It is used to add names of newly created elements (created with addPage() or createFolder() ) + + * @param expr + * @throws PagesModelException + */ + public void resetNamesContext(IModelExp expr) throws PagesModelException { + namesMapping = queryModel(expr); + } + + /** + * Check if the internal {@link ISashWindowsContentProvider} is conformed to the specified expression. + * @param expr + * @throws QueryException + */ + public void assertConform(IModelExp expr) throws PagesModelException { + + Object first; + if( expr instanceof WindowTerm) { + first = getFirstWindowModel(); + } + else if( expr instanceof PanelTerm) { + first = getFirstPanelModel(); + } + else { + throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + expr.toString() + ")"); + } + + CheckVisitor visitor = new CheckVisitor(); + expr.accept(visitor, first); + } + + /** + * Create an internal model conform to the specified expression. + * Any previous model is disguarded. + * + * This method should only be called once on a {@link SimpleSashWindowsContentProvider}. + *
+ * If an expr term have a name, this name is kept in the facade and can be used later in methods like move, delete, ... + * + * @param expr Expression denoting the configuration to create. Must be one of (Folder, HSash, VSash) + * @throws QueryException + * + * TODO Ensure that the method can only be called once. For example, + * let this class extends {@link SimpleSashWindowsContentProvider}, and the constructor + * call this method. + */ + public void createModel(IModelExp expr) throws PagesModelException { + + Window first ; + if( expr instanceof PanelTerm) { + first = getFirstWindowModel(); + } + else { + throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + expr.toString() + ")"); + } + + // Create a surrounding WindowTerm + WindowTerm windowTerm = new WindowTerm((PanelTerm)expr); + + CreateModelVisitor visitor = new CreateModelVisitor(); + windowTerm.accept(visitor, first); + + // Fill mapping + namesMapping = queryModel(expr); + } + + /** + * Get element in the model. + * Each model element whose corresponding model query part as a name is added to the result map. + * The element is then accessible with the name set in the query part. + * + * @param query + * @return + * @throws QueryException + */ + public Map queryModel(IModelExp query) throws PagesModelException { + + Object first; + if( query instanceof WindowTerm) { + first = getFirstWindowModel(); + } + else if( query instanceof PanelTerm) { + first = getFirstPanelModel(); + } + else { + throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); + } + + QueryVisitor visitor = new QueryVisitor(); + query.accept(visitor, first); + + return visitor.getResult(); + } + + /** + * Get the model of the first the first window (in actual implementation their is only one window). + * @return + */ + private Window getFirstWindowModel() { + // Silly method to get the RootModel + return contentProvider.getDiSashModel().getWindows().get(0); + } + + /** + * Get the panel of the first window (in actual implementation their is only one window). + * @return + */ + private AbstractPanel getFirstPanelModel() { + // + return contentProvider.getDiSashModel().getWindows().get(0).getPanel(); + } + + /** + * Add a page to the model + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade#addPage(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page, java.lang.String, int) + * + * @param page + * @param folderName + * @param index + * @throws PagesModelException + */ + public void /*IPageModel*/ addPage(Page page, String folderName, int index) throws PagesModelException { + // Get the folder + TabFolderModel folderModel = getITabFolderModel( folderName ); + + Object pageRawModel = createPageRawModel(page); + + contentProvider.addPage(folderModel, index, pageRawModel); + + // Create the IContentProvider model, and return it. +// IPageModel pageModel = folderModel.createChildSashModel(???); +// return pageModel; + } + + /** + * Add a page to the model + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade#addPage(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page, java.lang.String, int) + * + * @param page + * @param folderName + * @throws PagesModelException + */ + public void /*IPageModel*/ addPage(Page page, String folderName) throws PagesModelException { + // Get the folder + TabFolderModel folderModel = getITabFolderModel( folderName ); + + + Object pageRawModel = createPageRawModel(page); + + contentProvider.addPage(folderModel, pageRawModel); + + // Create the IContentProvider model, and return it. + // createChildSashModel() require a PageRef +// IPageModel pageModel = folderModel.createChildSashModel(???); +// return pageModel; + } + + /** + * Get the pageModel used as identifier of a page. + * In the {@link DiContentProvider} implementation, the pageModel + * is an Object. + * In this implementation, we simply return the identifier of the name found in the + * declared page. If none is set, return a new Object. + * + * @param page + * @return an identifier for te page + */ + static public Object createPageRawModel( Page page ) { + + if(page.getIdentifier() != null) { + return page.getIdentifier(); + } + else if(page.getName() != null) { + return page.getName(); + } + else { + return new Object(); + } + + } + + /** + * + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade#movePage(java.lang.String, int, int) + * + * @param folderName + * @param oldIndex + * @param newIndex + * @throws NotFoundException + */ + public void movePage(String folderName, int oldIndex, int newIndex) throws NotFoundException { + // Get the folder + ITabFolderModel folderModel = getITabFolderModel( folderName ); + + contentProvider.movePage(folderModel, oldIndex, newIndex); + } + + public void movePage(String srcFolderName, int sourceIndex, String targetFolderName, int targetIndex) throws NotFoundException { + // Get the folders + ITabFolderModel srcFolderModel = getITabFolderModel( srcFolderName ); + ITabFolderModel targetFolderModel = getITabFolderModel( targetFolderName ); + + contentProvider.movePage(srcFolderModel, sourceIndex, targetFolderModel, targetIndex); + } + + public void removePage(String pageName) throws NotFoundException { + IPageModel pageModel = getIPageModel(pageName); + + contentProvider.removePage(pageModel); + + } + + public void removePage(String folderName, int tabIndex) throws NotFoundException { + // Get the folder + ITabFolderModel folderModel = getITabFolderModel( folderName ); + + contentProvider.removePage(folderModel, tabIndex); + // TODO remove page name from context + } + + public void createFolder(String tabFolderName, int tabIndex, String targetFolderName, int side) throws PagesModelException { + // Get the folders + ITabFolderModel srcFolderModel = getITabFolderModel( tabFolderName ); + TabFolderModel targetFolderModel = getITabFolderModel( targetFolderName ); + + contentProvider.createFolder(srcFolderModel, tabIndex, targetFolderModel, side); + + } + + /** + * Add an element in namesMapping. Throw an exception if the name already exist or if the name is not correct. + * + * @param name + * @param element + * @throws BadNameException + */ + protected void putNameMapping( String name, Object element) throws BadNameException { + + if( name == null || name.length() == 0 ) { + throw new BadNameException("Name '" + name + "' is not valid."); + } + + if(namesMapping.containsKey(name)) { + throw new BadNameException("Name '" + name + "' already exist in the context. Can't add it (but element is created)."); + } + + } + /** + * Get the {@link ITabFolderModel} associated to the name. + * In this implementation, each internal model is wrapped with its {@link ISashWindowsContentProvider} counterpart. + * For a folder, the wrapper is a {@link TabFolderModel}. + * The wrapper are cached in an associated cache. + * @param folderName + * @return + * @throws NotFoundException + */ + public TabFolderModel getITabFolderModel(String folderName) throws NotFoundException { + + // Check if the wrapper is already in the cache + Object cachedModel = contentProviderWrapperCache.get(folderName); + if(cachedModel != null) { + // Check the type + if( ! (cachedModel instanceof TabFolderModel) ) + throw new NotFoundException("An element named '" + folderName + "' is found but it is not of the expected type (ITabFolderModel). " ); + + // Found + return (TabFolderModel)cachedModel; + } + // Not found, create it + // Create a new wrapper + // First, get the corresponding internal representation + Object rawModel = namesMapping.get(folderName); + if( rawModel == null ) + throw new NotFoundException("Folder named '" + folderName + "' not found in the context of the expression."); + if( ! (rawModel instanceof TabFolder) ) + throw new NotFoundException("An element named '" + folderName + "' is found but it is not of the expected type (TabFolder). " ); + + // Create a wrapper and put it in the cache + TabFolderModel tabFolderModel = (TabFolderModel)contentProvider.createChildSashModel(rawModel); + contentProviderWrapperCache.put(folderName, tabFolderModel); + + // result + return tabFolderModel; + + } + + /** + * Get the {@link IPageModel} associated to the name. + * In this implementation, this is the internal element. + * @param pageName + * @return + * @throws NotFoundException + */ + public IPageModel getIPageModel(String pageName) throws NotFoundException { + + // Check if the wrapper is already in the cache + Object cachedModel = contentProviderWrapperCache.get(pageName); + if(cachedModel != null) { + // Check the type + if( ! (cachedModel instanceof IPageModel) ) + throw new NotFoundException("An element named '" + pageName + "' is found but it is not of the expected type (IPageModel). " ); + + // Found + return (IPageModel)cachedModel; + } + // Not found, create it + // Create a new wrapper + // First, get the corresponding internal representation + Object rawModel = namesMapping.get(pageName); + if( rawModel == null ) + throw new NotFoundException("Page named '" + pageName + "' not found in the context of the expression."); + if( ! (rawModel instanceof PageRef) ) + throw new NotFoundException("An element named '" + pageName + "' is found but it is not of the expected type (PageRef). " ); + + // Create a wrapper and put it in the cache + IPageModel pageModel = (IPageModel)contentProvider.createChildSashModel(rawModel); + contentProviderWrapperCache.put(pageName, pageModel); + + // result + return pageModel; + + } + + /** + * Return the associated maps of (names, internal representation). + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade#getNamesToInternalMap() + * + * @return + */ + public Map getNamesToInternalMap() { + return namesMapping; + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacadeTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacadeTest.java new file mode 100644 index 00000000000..d66ffd6eccf --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderFacadeTest.java @@ -0,0 +1,44 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.AbstractSashWindowContentProviderFacadeTest; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade; + + +/** + * @author dumoulin + * + */ +public class DiContentProviderFacadeTest extends AbstractSashWindowContentProviderFacadeTest { + + /** + * Constructor. + * + */ + public DiContentProviderFacadeTest() { + super(); + } + + /** + * Return the concrete implementation under test. + * @return + */ + @Override + public ISashWindowsContentProviderFacade createISashWindowsContentProviderFacade() { + return new DiContentProviderFacade(); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderTest.java new file mode 100644 index 00000000000..7e78fec38b9 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/DiContentProviderTest.java @@ -0,0 +1,321 @@ +/***************************************************************************** + * 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: + * CEA LIST - Initial API and implementation + * Christian W. Damus - bug 485220 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IAbstractPanelModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IContentChangedListener; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IContentChangedListener.ContentEvent; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashPanelModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; +import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory; +import org.eclipse.papyrus.infra.core.sashwindows.di.AbstractPanel; +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; +import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; +import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils; +import org.eclipse.papyrus.junit.framework.classification.NotImplemented; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.eclipse.swt.SWT; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + + +/** + * + * @author cedric dumoulin + */ +public class DiContentProviderTest extends AbstractPapyrusTest { + + /** + * The {@link DiContentProvider} under test. + */ + protected MyDIContentProvider contentProvider; + + /** The FolderModel of the first TabFolder */ + protected ITabFolderModel folderModel; + + @Before + public void setUp() throws Exception { + IPageModelFactory pageModelFactory = new FakePageModelFactory(); + SashModel diSashModel = DiUtils.createDefaultSashModel(); + contentProvider = new MyDIContentProvider(diSashModel, pageModelFactory); + folderModel = lookupFolderModel(); + } + + /** + * + * @see junit.framework.TestCase#tearDown() + * + * @throws Exception + */ + @After + public void tearDown() throws Exception { + + } + + /** + * Lookup for a folder in the SashModel. Return the first folder found. + * + * @return + */ + private ITabFolderModel lookupFolderModel() { + if (contentProvider == null) { + return null; + } + + Object rawModel = contentProvider.getRootModel(); + IAbstractPanelModel panelModel = contentProvider.createChildSashModel(rawModel); + + return lookupFolderModel(panelModel); + } + + /** + * Recursively search in sash models for a FolderModel. + * Return the first encountered folder. + * + * @param panelModel + * @return + */ + private ITabFolderModel lookupFolderModel(IAbstractPanelModel panelModel) { + + if (panelModel instanceof ITabFolderModel) { + return (ITabFolderModel) panelModel; + } else { + ISashPanelModel sashModel = (ISashPanelModel) panelModel; + // Iterate on children + for (Object child : sashModel.getChildren()) { + IAbstractPanelModel childModel = contentProvider.createChildSashModel(child); + ITabFolderModel res = lookupFolderModel(childModel); + if (res != null) { + return res; + } + } + } + // Not found + return null; + } + + + /** + * Test a typical life cycle on contentProvider: + * creation, add change listener, add pages, move page + */ + @Test + public void testLifeCycle() { + + // A listener on change event. + ContentChangeListener changeListener = new ContentChangeListener(); + + // Set change listener + contentProvider.getContentChangedEventProvider().addListener(changeListener); + + // Add identifiers + // Use Object as identifiers. + List identifiers = new ArrayList(); + // Add 10 folders + for (int i = 0; i < 10; i++) { + // reset change count + changeListener.reset(); + // Add Editor + Object id = new Object(); + identifiers.add(id); + contentProvider.addPage(id); + + // Check fired events + Assert.assertEquals("One event fired", 1, changeListener.getChangeCount()); + } + + // Test moving a page + changeListener.reset(); + contentProvider.movePage(folderModel, 3, 8); + // Check fired events + Assert.assertEquals("One event fired", 1, changeListener.getChangeCount()); + + } + + + + /** + * Test type of the root model. + * Actually, it should be subtype of AbstractPanel {@link DiContentProvider#getRootModel()} + */ + @Test + public void testGetRootModel() { + + Assert.assertTrue("subtype of AbstractPanel", AbstractPanel.class.isInstance(contentProvider.getRootModel())); + } + + + /** + * Test {@link DiContentProvider#createFolder(ITabFolderModel, int, ITabFolderModel, int)} + */ + @Test + public void testCreateFolder() { + + // A listener on change event. + ContentChangeListener changeListener = new ContentChangeListener(); + // Set change listener + contentProvider.getContentChangedEventProvider().addListener(changeListener); + + // Add pages in the model + // Use Object as identifiers. + List identifiers = new ArrayList(); + // Add 10 pages + for (int i = 0; i < 5; i++) { + // reset change count + changeListener.reset(); + // Add Editor + Object id = new Object(); + identifiers.add(id); + contentProvider.addPage(id); + } + + // reset change count + changeListener.reset(); + // create a folder + contentProvider.createFolder(folderModel, 3, folderModel, SWT.RIGHT); + Assert.assertEquals("One event fired", 1, changeListener.getChangeCount()); + + // Check if pageIdentifier 3 have change of folder + PageRef pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(3)); + Assert.assertNotNull("Moved page have a parent", pageRef.getParent()); + Assert.assertNotSame("Moved page is in another parent", ((TabFolderModel) folderModel).getTabFolder(), pageRef.getParent()); + + // reset change count + changeListener.reset(); + // Test creating a third folder + contentProvider.createFolder(folderModel, 2, folderModel, SWT.UP); + Assert.assertEquals("One event fired", 1, changeListener.getChangeCount()); + // Check if pageIdentifier 2 have change of folder + pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(2)); + Assert.assertNotNull("Moved page have a parent", pageRef.getParent()); + Assert.assertNotSame("Moved page is in another parent", ((TabFolderModel) folderModel).getTabFolder(), pageRef.getParent()); + } + + /** + * Check if {@link DiContentProvider#setCurrentFolder(Object)}. + * Check if the method works and DO NO send any event. + */ + @Test + @NotImplemented("This test is currently deprecated; current folder cannot be set programmatically") + public void testSetCurrentFolder() { + // A listener on change event. + ContentChangeListener changeListener = new ContentChangeListener(); + // Set change listener + contentProvider.getContentChangedEventProvider().addListener(changeListener); + + // Add pages in the model + // Use Object as identifiers. + List identifiers = new ArrayList(); + // Add 10 pages + for (int i = 0; i < 5; i++) { + // reset change count + changeListener.reset(); + // Add Editor + Object id = new Object(); + identifiers.add(id); + contentProvider.addPage(id); + } + + // reset change count + changeListener.reset(); + // create a folder + contentProvider.createFolder(folderModel, 3, folderModel, SWT.RIGHT); + Assert.assertEquals("One event fired", 1, changeListener.getChangeCount()); + + + // Get the real di implementation of the first folder + TabFolder firstFolder = ((TabFolderModel) folderModel).getTabFolder(); + TabFolder createdDiFolder = contentProvider.getDiSashModel().getCurrentSelection(); + + // Check if the folder has changed + Assert.assertNotSame("current folder has change", firstFolder, createdDiFolder); + // Get the created folder + + // Try to change the current selection by setting the first folder again + changeListener.reset(); + contentProvider.setCurrentFolder(firstFolder); + // Check if really changed + Assert.assertEquals("current folder set correctly", firstFolder, contentProvider.getDiSashModel().getCurrentSelection()); + Assert.assertEquals("No event fired", 0, changeListener.getChangeCount()); + } + + + /** + * Listener on ContentChange. + * + * @author dumoulin + */ + public class ContentChangeListener implements IContentChangedListener { + + /** Count number of change event */ + private int changeCount = 0; + + + /** + * @return the changeCount + */ + public int getChangeCount() { + return changeCount; + } + + public void contentChanged(ContentEvent event) { + changeCount++; + } + + public void reset() { + changeCount = 0; + } + } + + // + // Nested types + // + + static class MyDIContentProvider extends DiContentProvider { + + MyDIContentProvider(SashModel diSashModel, IPageModelFactory pageModelFactory) throws IllegalArgumentException { + super(diSashModel, pageModelFactory); + } + + MyDIContentProvider(SashModel diSashModel, IPageModelFactory pageModelFactory, ContentChangedEventProvider contentChangedEventProvider) throws IllegalArgumentException { + super(diSashModel, pageModelFactory, contentChangedEventProvider); + } + + // Overridden to make it accessible + @Override + protected SashModel getDiSashModel() { + return super.getDiSashModel(); + } + + // Overridden to make it accessible + @Override + protected ContentChangedEventProvider getContentChangedEventProvider() { + return super.getContentChangedEventProvider(); + } + + // Overridden to make it accessible + @Override + protected void firePropertyChanged(ContentEvent event) { + super.firePropertyChanged(event); + } + + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/FakePageModelFactory.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/FakePageModelFactory.java new file mode 100644 index 00000000000..bf5d29c0d12 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/FakePageModelFactory.java @@ -0,0 +1,37 @@ +/***************************************************************************** + * Copyright (c) 2009 CEA LIST & LIFL + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory; + + +/** + * @author dumoulin + */ +public class FakePageModelFactory implements IPageModelFactory { + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory#createIPageModel(java.lang.Object) + * + * @param pageIdentifier + * @return + */ + public IPageModel createIPageModel(Object pageIdentifier) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/PageManagerImplTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/PageManagerImplTest.java new file mode 100644 index 00000000000..b563cd91000 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/PageManagerImplTest.java @@ -0,0 +1,486 @@ +/***************************************************************************** + * Copyright (c) 2009, 2016 CEA LIST, LIFL, 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: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * Christian W. Damus - bug 485220 + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IAbstractPanelModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashPanelModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; +import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory; +import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.DiContentProviderTest.MyDIContentProvider; +import org.eclipse.papyrus.infra.core.sashwindows.di.AbstractPanel; +import org.eclipse.papyrus.infra.core.sashwindows.di.DiFactory; +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashWindowsMngr; +import org.eclipse.papyrus.infra.core.sashwindows.di.impl.TabFolderImpl; +import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.eclipse.swt.SWT; +import org.junit.Before; +import org.junit.Test; + + +/** + * @author dumoulin + */ +public class PageManagerImplTest extends AbstractPapyrusTest { + + /** + * The {@link PageManagerImpl} under test. + */ + protected PageManagerImpl pageMngr; + + /** + * The associated {@link DiContentProvider}. Not tested, but used to check events. + */ + protected MyDIContentProvider contentProvider; + + /** + * @see junit.framework.TestCase#setUp() + * + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + SashWindowsMngr diSashModel = DiUtils.createDefaultSashWindowsMngr(); + + // Fix bug to match refactoring in Bug 429239. The current implementation computes allPages() dynamically, + // and doesn't support addPage() and removePage() anymore + // Because this test is used in a different context, where allPages() cannot be computed dynamically, + // we need to create a specific setup + diSashModel.setPageList(DiFactory.eINSTANCE.createPageList()); + ContentChangedEventProvider eventProvider = new ContentChangedEventProvider(diSashModel); + pageMngr = new PageManagerImpl(diSashModel, eventProvider) { + @Override + protected boolean isLegacyMode() { + return true; + } + }; + + IPageModelFactory pageModelFactory = new FakePageModelFactory(); + contentProvider = new MyDIContentProvider(diSashModel.getSashModel(), pageModelFactory, eventProvider); + + } + + /** + * Lookup for a folder in the SashModel. Return the first folder found. + * + * @return + */ + private ITabFolderModel lookupFolderModel() { + if (contentProvider == null) { + return null; + } + + Object rawModel = contentProvider.getRootModel(); + // Create the requested model suitable for the folder. + // It is possible (but not recommended) to create several models for the same object. + // We can avoid this by using a Map of created models. + IAbstractPanelModel panelModel = contentProvider.createChildSashModel(rawModel); + + return lookupFolderModel(panelModel); + } + + /** + * Recursively search in sash models for a FolderModel. + * Return the first encountered folder. + * + * @param panelModel + * @return + */ + private ITabFolderModel lookupFolderModel(IAbstractPanelModel panelModel) { + + if (panelModel instanceof ITabFolderModel) { + return (ITabFolderModel) panelModel; + } else { + ISashPanelModel sashModel = (ISashPanelModel) panelModel; + // Iterate on children + for (Object child : sashModel.getChildren()) { + IAbstractPanelModel childModel = contentProvider.createChildSashModel(child); + ITabFolderModel res = lookupFolderModel(childModel); + if (res != null) { + return res; + } + } + } + // Not found + return null; + } + + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageMngrImpl#addPage(org.eclipse.emf.ecore.EObject)}. + */ + @Test + public void testAddPage() { + // A listener on change event. + ContentChangeListener changeListener = new ContentChangeListener(); + + // Set change listener + contentProvider.getContentChangedEventProvider().addListener(changeListener); + + // Add identifiers + // Use Object as identifiers. + List identifiers = new ArrayList(); + // Add 10 folders + for (int i = 0; i < 10; i++) { + // reset change count + changeListener.reset(); + // Add Editor + Object id = new Object(); + identifiers.add(id); + pageMngr.addPage(id); + + // Check no fired events + assertEquals("One event fired", 0, changeListener.getChangeCount()); + } + + // Check if pages are in PageList + assertEquals("all pages added", 10, pageMngr.allPages().size()); + + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageMngrImpl#allPages()}. + */ + @Test + public void testAllPages() { + // A listener on change event. + ContentChangeListener changeListener = new ContentChangeListener(); + + // Set change listener + contentProvider.getContentChangedEventProvider().addListener(changeListener); + + // Add identifiers + // Use Object as identifiers. + List identifiers = new ArrayList(); + // Add 10 folders + for (int i = 0; i < 10; i++) { + // reset change count + changeListener.reset(); + // Add Editor + Object id = new Object(); + identifiers.add(id); + pageMngr.openPage(id); + + // Check fired events + assertEquals("One event fired", 1, changeListener.getChangeCount()); + } + // Check if pages are in PageList + assertEquals("all pages found", 10, pageMngr.allPages().size()); + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageMngrImpl#closePage(org.eclipse.emf.ecore.EObject)}. + */ + @Test + public void testClosePage() { + // A listener on change event. + ContentChangeListener changeListener = new ContentChangeListener(); + + // Set change listener + contentProvider.getContentChangedEventProvider().addListener(changeListener); + + // Add identifiers + // Use Object as identifiers. + List identifiers = new ArrayList(); + // Add 10 folders + for (int i = 0; i < 10; i++) { + // reset change count + changeListener.reset(); + // Add Editor + Object id = new Object(); + identifiers.add(id); + pageMngr.openPage(id); + + // Check fired events + assertEquals("One event fired", 1, changeListener.getChangeCount()); + } + // Check if pages are in PageList + assertEquals("all pages added", 10, pageMngr.allPages().size()); + + // Close page + changeListener.reset(); + pageMngr.closePage(identifiers.get(3)); + + // Check fired events + assertEquals("One event fired", 1, changeListener.getChangeCount()); + + // Check page still in pages + assertEquals("all pages still in list", 10, pageMngr.allPages().size()); + + // Check if pages are in SashStructure + PageRef pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(3)); + assertNull("Page removed from sashStructure ", pageRef); + + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageMngrImpl#closeAllOpenedPages())}. + */ + @Test + public void testCloseAllOpenedPages() { + // A listener on change event. + ContentChangeListener changeListener = new ContentChangeListener(); + + // Set change listener + contentProvider.getContentChangedEventProvider().addListener(changeListener); + + // Add identifiers + // Use Object as identifiers. + List identifiers = new ArrayList(); + // Add 10 folders + for (int i = 0; i < 10; i++) { + // reset change count + changeListener.reset(); + // Add Editor + Object id = new Object(); + identifiers.add(id); + pageMngr.openPage(id); + + // Check fired events + assertEquals("One event fired", 1, changeListener.getChangeCount()); + } + // Check if pages are in PageList + assertEquals("all pages added", 10, pageMngr.allPages().size()); + + // Close page + changeListener.reset(); + pageMngr.closeAllOpenedPages(); + + // Check fired events + assertEquals("One event fired", 1, changeListener.getChangeCount()); + + // Check page still in pages + assertEquals("all pages still in list", 10, pageMngr.allPages().size()); + + // Check if pages are in SashStructure + for (int i = 0; i < 10; i++) { + PageRef pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(i)); + assertNull("Page " + i + " removed from sashStructure ", pageRef); + } + + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageMngrImpl#closeAllOpenedPages())}. + */ + @Test + public void testCloseOtherOpenedPages() { + // A listener on change event. + ContentChangeListener changeListener = new ContentChangeListener(); + + // Set change listener + contentProvider.getContentChangedEventProvider().addListener(changeListener); + + // Add identifiers + // Use Object as identifiers. + List identifiers = new ArrayList(); + // Add 10 folders + for (int i = 0; i < 10; i++) { + // reset change count + changeListener.reset(); + // Add Editor + Object id = new Object(); + identifiers.add(id); + pageMngr.openPage(id); + + // Check fired events + assertEquals("One event fired", 1, changeListener.getChangeCount()); + } + // Check if pages are in PageList + assertEquals("all pages added", 10, pageMngr.allPages().size()); + + // Close page + changeListener.reset(); + pageMngr.closeOtherPages(identifiers.get(3)); + + // Check fired events + assertEquals("One event fired", 1, changeListener.getChangeCount()); + + // Check page still in pages + assertEquals("all pages still in list", 10, pageMngr.allPages().size()); + + // Check if pages are in SashStructure + for (int i = 0; i < 10; i++) { + PageRef pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(i)); + if (i != 3) { + assertNull("Page " + i + " removed from sashStructure ", pageRef); + } else { + assertNotNull("Page " + i + " not removed from sashStructure ", pageRef); + } + } + + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageMngrImpl#openPage(org.eclipse.emf.ecore.EObject)}. + */ + @Test + public void testOpenPage() { + // A listener on change event. + ContentChangeListener changeListener = new ContentChangeListener(); + + // Set change listener + contentProvider.getContentChangedEventProvider().addListener(changeListener); + + // Add identifiers + // Use Object as identifiers. + List identifiers = new ArrayList(); + // Add 10 folders + for (int i = 0; i < 10; i++) { + // reset change count + changeListener.reset(); + // Add Editor + Object id = new Object(); + identifiers.add(id); + pageMngr.openPage(id); + + // Check fired events + assertEquals("One event fired", 1, changeListener.getChangeCount()); + } + + // Check if pages are in PageList + assertEquals("all pages added", 10, pageMngr.allPages().size()); + + // Check if pages are in SashStructure + PageRef pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(3)); + assertNotNull("Page exist in sashStructure ", pageRef); + assertSame("found the right page", identifiers.get(3), pageRef.getPageIdentifier()); + + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageMngrImpl#removePage(org.eclipse.emf.ecore.EObject)}. + */ + @Test + public void testRemovePage() { + // A listener on change event. + ContentChangeListener changeListener = new ContentChangeListener(); + + // Set change listener + contentProvider.getContentChangedEventProvider().addListener(changeListener); + + // Add identifiers + // Use Object as identifiers. + List identifiers = new ArrayList(); + // Add 10 folders + for (int i = 0; i < 10; i++) { + // reset change count + changeListener.reset(); + // Add Editor + Object id = new Object(); + identifiers.add(id); + pageMngr.openPage(id); + + // Check fired events + assertEquals("One event fired", 1, changeListener.getChangeCount()); + } + // Check if pages are in PageList + assertEquals("all pages added", 10, pageMngr.allPages().size()); + // Check if page id is in page list + assertTrue("check page id is added to page list", pageMngr.allPages().contains(identifiers.get(3))); + + // Close page + changeListener.reset(); + pageMngr.removePage(identifiers.get(3)); + + // Check fired events + assertEquals("One event fired", 1, changeListener.getChangeCount()); + + // Check page still in pages + assertEquals("page remove from list", 9, pageMngr.allPages().size()); + + // Check removed from page list + assertFalse("check removed from page list", pageMngr.allPages().contains(identifiers.get(3))); + + // Check if pages are in SashStructure + PageRef pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(3)); + assertNull("Page removed from sashStructure ", pageRef); + } + + /** + * Check if closing the last page in a second tabfolder work propoerly. + * Create 3 editors, move one in a new folder, then remove the moved one. + * The new folder should automatically be removed. + * + */ + @Test + public void testCloseLastPageOfTabFolder() { + // A listener on change event. + ContentChangeListener changeListener = new ContentChangeListener(); + + // Set change listener + contentProvider.getContentChangedEventProvider().addListener(changeListener); + + // Create 3 editors, move one in another table + // Then remove the moved one. + + // Add identifiers + // Use Object as identifiers. + List identifiers = new ArrayList(); + // Add pages + int pageCount = 3; + for (int i = 0; i < pageCount; i++) { + // Add Editor + Object id = new Object(); + identifiers.add(id); + pageMngr.openPage(id); + } + // Check if pages are in PageList + assertEquals("all pages added", pageCount, pageMngr.allPages().size()); + + + // Move the last page + int movedPageIndex = 0; + ITabFolderModel tabFolder = lookupFolderModel(); + assertTrue("Moved page index is valid", movedPageIndex < pageCount); + + contentProvider.createFolder(tabFolder, movedPageIndex, tabFolder, SWT.TOP); + // check if the folder is created + // List folders = getAllFolders(contentProvider.getDiSashModel()); + // assertEquals("additional folder is removed", 2, folders.size()); + + // Close page + pageMngr.closePage(identifiers.get(movedPageIndex)); + + // Check the resulting model: we should have one folder with two page. + // folders = getAllFolders(contentProvider.getDiSashModel()); + // assertEquals("additional folder is removed", 1, folders.size()); + + List children = contentProvider.getDiSashModel().getWindows().get(0).getChildren(); + assertEquals("Windows has one child", 1, children.size()); + assertEquals("Windows child is the tabfolder", TabFolderImpl.class, children.get(0).getClass()); + + // Check if pages are in SashStructure + PageRef pageRef = contentProvider.getDiSashModel().lookupPage(identifiers.get(movedPageIndex)); + assertNull("Page removed from sashStructure ", pageRef); + + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/QueryVisitor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/QueryVisitor.java new file mode 100644 index 00000000000..767158b6000 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/QueryVisitor.java @@ -0,0 +1,138 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelObject; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; +import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; +import org.eclipse.papyrus.infra.core.sashwindows.di.Window; + +/** + * Visitor used to collect element in the model. + * Each element in the model associated with a{@link IQueryTerm} whose name is set is collectted. + * The collected element is then accessible from the result map, using the name set in the IQueryTerm. + * + * + * @author cedric dumoulin + * + */ +public class QueryVisitor extends DiContentProviderBaseVisitor implements IPagesModelVisitor { + + /** + * The result map. + */ + protected Mapresult = new HashMap(); + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) + * + * @param windowTerm + * @param windowModel + */ + @Override + public void visit(WindowTerm windowTerm, Window windowModel) { + collect( windowTerm, windowModel); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder, org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder) + * + * @param folder + * @param folderModel + */ + @Override + public void visit(Folder folder, TabFolder folderModel) { + collect(folder, folderModel); + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) + * + * @param sash + * @param sashModel + */ + @Override + public void visit(HSash sash, SashPanel sashModel) { + collect(sash, sashModel); + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) + * + * @param sash + * @param sashModel + */ + @Override + public void visit(VSash sash, SashPanel sashModel) { + collect(sash, sashModel); + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page, org.eclipse.papyrus.infra.core.sashwindows.di.PageRef) + * + * @param page + * @param pageModel + */ + @Override + public void visit(Page page, PageRef pageModel) { + collect(page, pageModel); + + } + + /** + * Add the element associated to the query to the result, if the query has a name. + * @param iQueryTerm + * @param element + */ + protected void collect( IModelObject iQueryTerm, Object element) { + + if( iQueryTerm.getName() == null) { + return; + } + + result.put(iQueryTerm.getName(), element); + } + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#isVisitingParentFirst() + * + * @return + */ + @Override + public boolean isVisitingParentFirst() { + return true; + } + + /** + * @return the result + */ + public Map getResult() { + return result; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/SashContainerModels.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/SashContainerModels.java new file mode 100644 index 00000000000..9e8cc663449 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/SashContainerModels.java @@ -0,0 +1,63 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; + +/** + * A class used to translate di models to {@link ISashWindowsContentProvider} models. + * + * + * @author cedric dumoulin + * + */ +public class SashContainerModels { + + protected Map diModelElements; + + protected Map cache = new HashMap(); + + protected DiContentProvider diContentProvider; + /** + * Constructor. + * + * @param diModelElements + */ + public SashContainerModels(DiContentProvider diContentProvider, Map diModelElements) { + this.diModelElements = diModelElements; + this.diContentProvider = diContentProvider; + } + + + /** + * @param string + * @return + */ + public ITabFolderModel getFolder(String name) { + + ITabFolderModel result = (ITabFolderModel)cache.get(name); + if(result==null) { + // Create container model and cache it + result = (ITabFolderModel)diContentProvider.createChildSashModel(diModelElements.get(name)); + + cache.put(name, result); + } + return result; + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/TransactionalDiContentProvider2Test.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/TransactionalDiContentProvider2Test.java new file mode 100644 index 00000000000..4b07a342193 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/TransactionalDiContentProvider2Test.java @@ -0,0 +1,170 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal; + +import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.folder; +import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.page; + +import java.util.Map; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IPageModelFactory; +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryExp; +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.QueryException; +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; +import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * @author dumoulin + * + */ +public class TransactionalDiContentProvider2Test extends AbstractDiContentProviderTest { + + protected TransactionalEditingDomain editingDomain; + + /* + * + */ + @Before + public void setUp() throws Exception { + + editingDomain = TransactionalEditingDomain.Factory.INSTANCE.createEditingDomain(); + + + // Register the default resource factory -- only needed for stand-alone! + editingDomain.getResourceSet().getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); + + + final Resource resource = editingDomain.createResource("temp.di"); + + IPageModelFactory pageModelFactory = new FakePageModelFactory(); + final SashModel diSashModel = DiUtils.createDefaultSashModel(); + + // Add model to ResourceSet + editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) { + + @Override + protected void doExecute() { + resource.getContents().add(diSashModel); + } + }); + + + diContentProvider = new DiContentProvider(diSashModel, pageModelFactory); + + + + contentProvider = new TransactionalDiContentProvider(diContentProvider, editingDomain); + // Create model query + modelQuery = new SashModelQuery(diSashModel); + } + + /** + * + * @see junit.framework.TestCase#tearDown() + * + * @throws Exception + */ + @After + public void tearDown() throws Exception { + editingDomain.dispose(); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.AbstractDiContentProviderTest#createModel(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm) + * + * @param query + * @throws QueryException + */ + @Override + protected void createModel(final IQueryExp query) throws QueryException { + editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) { + + @Override + protected void doExecute() { + try { + modelQuery.createModel(query); + } catch (QueryException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + + } + + /** + * Test undo/Redo moving a page inside the same folder + * + * @throws QueryException + */ + @Test + public void testUndoRedoMovePageInsideFolder() throws QueryException { + + // Create a folder with several page + IQueryExp query1 = folder("f1", page("p1"), page("p2"), page("p3")); + createModel(query1); + // Check creation + modelQuery.assertConform(query1); + + // get models (from diModels, and factory for sashModel) + Map modelElements = modelQuery.queryModel(query1); + final SashContainerModels sashModels = new SashContainerModels(diContentProvider, modelElements); + + // do action : move a page + //Fix test after refactoring in Bug 429239: by default, the contentProvider actions are transactional, but not undoable + //Create a recording command to force it to be undoable + RecordingCommand movePageCommand = new RecordingCommand(editingDomain, "Move page") { + + @Override + protected void doExecute() { + contentProvider.movePage(sashModels.getFolder("f1"), 1, 0); + } + }; + editingDomain.getCommandStack().execute(movePageCommand); + //End of fix for Bug 429239 + + // check result + IQueryExp query2 = folder("f1", page("p2"), page("p1"), page("p3")); + modelQuery.assertConform(query2); + + // do action : undo + editingDomain.getCommandStack().undo(); + // check result + modelQuery.assertConform(query1); + + // do action : redo + editingDomain.getCommandStack().redo(); + // check result + modelQuery.assertConform(query2); + + // do action : undo + editingDomain.getCommandStack().undo(); + // check result + modelQuery.assertConform(query1); + + // do action : redo + editingDomain.getCommandStack().redo(); + // check result + modelQuery.assertConform(query2); + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/AbstractSash.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/AbstractSash.java new file mode 100644 index 00000000000..b77038d0484 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/AbstractSash.java @@ -0,0 +1,97 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +import org.eclipse.emf.ecore.EObject; + +/** + * Base class for structure representing sash in Checker + * @author cedric dumoulin + * + */ +public abstract class AbstractSash extends PanelTerm { + + protected PanelTerm leftup; + protected PanelTerm rightdown; + + /** + * Constructor. + * + */ + public AbstractSash(PanelTerm left, PanelTerm right) { + this.leftup = left; + this.rightdown = right; + } + + /** + * Constructor. + * + * @param name + * @param up + * @param down + */ + public AbstractSash(String name, PanelTerm left, PanelTerm right) { + super(name); + this.leftup = left; + this.rightdown = right; + } + + /** + * @return the leftup + */ + public PanelTerm getLeftup() { + return leftup; + } + + /** + * @return the rightdown + */ + public PanelTerm getRightdown() { + return rightdown; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor) + * + * @param visitor + * @throws QueryException + */ + abstract public void accept(IQueryVisitor visitor, EObject modelObject) throws QueryException ; + + /** + * @return The name used in toString + */ + protected abstract String getStringName(); + + /** + * @see java.lang.Object#toString() + * + * @return + */ + @Override + public String toString() { + + StringBuffer buff = new StringBuffer(getStringName()); + + buff.append("("); + buff.append(leftup.toString()); + buff.append(", "); + buff.append(rightdown.toString()); + buff.append(")"); + + return buff.toString(); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CheckVisitor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CheckVisitor.java new file mode 100644 index 00000000000..2a2128afa76 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CheckVisitor.java @@ -0,0 +1,97 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; +import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; + + +/** + * @author cedric dumoulin + * + */ +public class CheckVisitor implements IQueryVisitor { + + /** + * @return the isVisitingParentFirst + */ + public boolean isVisitingParentFirst() { + return false; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) + * + * @param windowTerm + * @param windowModel + */ + public void visit(WindowTerm windowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window windowModel) { + // TODO Auto-generated method stub + + } + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder) + * + * @param folder + */ + public void visit(Folder folder, TabFolder folderModel) { + // Check name + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash) + * + * @param sash + */ + public void visit(HSash sash, SashPanel sashModel) { + // TODO Auto-generated method stub + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash) + * + * @param sash + */ + public void visit(VSash sash , SashPanel sashModel) { + // TODO Auto-generated method stub + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page) + * + * @param page + * @throws NoMatchException + */ + public void visit(Page page, PageRef pageModel) throws QueryException { + //check name + if(page.getIdentifier() != null) { + checkName(page.getIdentifier(), pageModel.getPageIdentifier()) ; + } + else if(page.getName() != null) { + checkName(page.getName(), pageModel.getPageIdentifier()) ; + } + } + + + protected void checkName( Object expectedName, Object foundName) throws NoMatchException { + if( expectedName != foundName ) + throw new NoMatchException( "Names do not match (expected=" + + expectedName + ", found="+ foundName ); + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CreateModelVisitor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CreateModelVisitor.java new file mode 100644 index 00000000000..b81a1259ab4 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/CreateModelVisitor.java @@ -0,0 +1,138 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +import org.eclipse.papyrus.infra.core.sashwindows.di.DiFactory; +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; +import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; +import org.eclipse.papyrus.infra.core.sashwindows.di.Window; +import org.eclipse.swt.SWT; + +/** + * This visitor is used with {@link IQueryTerm} to create a {@link SashModel} instancied + * with the Sash, folders and pages specified in the query. + * + * + * @author cedric dumoulin + * + */ +public class CreateModelVisitor implements IQueryVisitor { + + /** + * @return the isVisitingParentFirst + */ + public boolean isVisitingParentFirst() { + return true; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) + * + * @param windowTerm + * @param windowModel + */ + public void visit(WindowTerm windowTerm, Window windowModel) { + // Create children of the sash + PanelTerm panel = windowTerm.getPanel(); + if(panel instanceof AbstractSash) { + windowModel.setPanel(DiFactory.eINSTANCE.createSashPanel()); + } + else if (panel instanceof Folder) { + windowModel.setPanel(DiFactory.eINSTANCE.createTabFolder()); + } + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder, org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder) + * + * @param folder + * @param folderModel + */ + public void visit(Folder folder, TabFolder folderModel) { + + // Create children of the folder + for( Page page : folder.getPages() ) { + folderModel.getChildren().add(DiFactory.eINSTANCE.createPageRef()); + } + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) + * + * @param sashQuery + * @param sashModel + */ + public void visit(HSash sashQuery, SashPanel sashModel) { + + // sash orientation + sashModel.setDirection(SWT.HORIZONTAL); + // Create children of the sash + + createPanelOrFolder(sashQuery.leftup, sashModel); + createPanelOrFolder(sashQuery.rightdown, sashModel); + } + + /** + * @param sashModel + * @param panel + */ + private void createPanelOrFolder(PanelTerm panel, SashPanel parent ) { + if(panel instanceof AbstractSash) { + parent.getChildren().add(DiFactory.eINSTANCE.createSashPanel()); + } + else if (panel instanceof Folder) { + parent.getChildren().add(DiFactory.eINSTANCE.createTabFolder()); + } + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) + * + * @param sash + * @param sashModel + */ + public void visit(VSash sashQuery, SashPanel sashModel) { + // sash orientation + sashModel.setDirection(SWT.VERTICAL); + // Create children of the sash + createPanelOrFolder(sashQuery.leftup, sashModel); + createPanelOrFolder(sashQuery.rightdown, sashModel); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page, org.eclipse.papyrus.infra.core.sashwindows.di.PageRef) + * + * @param page + * @param pageModel + */ + public void visit(Page page, PageRef pageModel) { + + + if(page.getIdentifier() != null) { + pageModel.setPageIdentifier(page.getIdentifier()); + } + else if(page.getName() != null) { + pageModel.setPageIdentifier(page.getName()); + } + else { + pageModel.setPageIdentifier(new Object()); + } + + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Folder.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Folder.java new file mode 100644 index 00000000000..c83b9172ffe --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Folder.java @@ -0,0 +1,126 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; +import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; + +/** + * This represent a Folder in the Checker query. + * + * @author cedric dumoulin + */ +public class Folder extends PanelTerm implements IQueryTerm { + + protected List pages; + + /** + * Constructor. + * + */ + public Folder(Page ... pages) { + this.pages = Arrays.asList(pages); + } + + /** + * Constructor. + * + */ + public Folder(String name, Page ... pages) { + super(name); + this.pages = Arrays.asList(pages); + } + + /** + * @return the pages + */ + public List getPages() { + return pages; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm#accept(IQueryVisitor, EObject) + * + * @param visitor + * @throws QueryException + */ + public void accept(IQueryVisitor visitor, EObject modelObject) throws QueryException { + + // Check associated model type + if(! (modelObject instanceof TabFolder) ) { + throw new NoMatchException( this.toString() + " - Model object type does not match to FolderQueryPart" ); + } + TabFolder folderModel = (TabFolder)modelObject; + + // Visit this + if( visitor.isVisitingParentFirst() ) { + visitor.visit(this, folderModel); + } + + // visit children + Iterator pageRefs = folderModel.getChildren().iterator(); + Iterator pageQueries = pages.iterator(); + while (pageRefs.hasNext() && pageQueries.hasNext() ) { + PageRef pageRef = pageRefs.next(); + Page query = pageQueries.next(); + + query.accept(visitor, pageRef); + } + if (pageRefs.hasNext()) { + // some page left + throw new NoMatchException( "Folder matching - " + + this.toString() + +" folder model have more pages than folder query." ); + } else if (pageQueries.hasNext() ) { + // some queries left + throw new NoMatchException( "Folder matching - " + + this.toString() + +" folder query have more page than folder model." ); + } + + // Visit this + if( ! visitor.isVisitingParentFirst() ) { + visitor.visit(this, folderModel); + } + } + + /** + * @see java.lang.Object#toString() + * + * @return + */ + @Override + public String toString() { + + StringBuffer buff = new StringBuffer("Folder("); + + for(Page page : pages ) { + buff.append(page.toString()).append(", "); + } + // Remove extra , + int length = buff.length(); + if(buff.charAt(length-1) == ' ') { + buff.delete(length-2, length ); + } + buff.append(")"); + + return buff.toString(); + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/HSash.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/HSash.java new file mode 100644 index 00000000000..198a505f071 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/HSash.java @@ -0,0 +1,87 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; + +/** + * @author dumoulin + * + */ +public class HSash extends AbstractSash { + + /** + * Constructor. + * + * @param leftup + * @param rightdown + */ + public HSash(PanelTerm up, PanelTerm down) { + super(up, down); + } + + /** + * Constructor. + * + * @param leftup + * @param rightdown + */ + public HSash(String name, PanelTerm up, PanelTerm down) { + super(name, up, down); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm#accept(IQueryVisitor, EObject) + * + * @param visitor + * @throws QueryException + */ + public void accept(IQueryVisitor visitor, EObject modelObject) throws QueryException { + // Check associated model type + if(! (modelObject instanceof SashPanel) ) { + throw new NoMatchException( this.toString() + " - Model object type does not match to SashPanel (found " + + modelObject.getClass() + + " )"); + } + + SashPanel sashModel = (SashPanel)modelObject; + + // Visit this + if( visitor.isVisitingParentFirst() ) { + visitor.visit(this, sashModel); + } + + // Visit children + leftup.accept(visitor, sashModel.getChildren().get(0)); + rightdown.accept(visitor, sashModel.getChildren().get(1)); + + if( !visitor.isVisitingParentFirst() ) { + visitor.visit(this, sashModel); + } + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.AbstractSash#getStringName() + * + * @return + */ + @Override + protected String getStringName() { + return "HSash"; + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryExp.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryExp.java new file mode 100644 index 00000000000..29476824cb0 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryExp.java @@ -0,0 +1,28 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +/** + * A Query Expression represent an expression used to query a SashModel. + * Term implementing this interface can be used as starting point of expression. + *
+ * Following classses are expressions: {@link PanelTerm}, {@link WindowTerm}. + * + * @author cedric dumoulin + * + */ +public interface IQueryExp extends IQueryTerm { + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryTerm.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryTerm.java new file mode 100644 index 00000000000..a07c3ff0191 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryTerm.java @@ -0,0 +1,40 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +import org.eclipse.emf.ecore.EObject; + +/** + * A Query term is a part of a Query expression. + * All term that can be used in a query should implement this interface. + * + * @author cedric dumoulin + * + */ +public interface IQueryTerm { + + /** + * Visit the query. + * @param visitor + * @throws QueryException + */ + public void accept(IQueryVisitor visitor, EObject panel) throws QueryException; + + /** + * Get the name associated to the query part. + * Can return null; + */ + public String getName(); +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryVisitor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryVisitor.java new file mode 100644 index 00000000000..66a9f19ded9 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/IQueryVisitor.java @@ -0,0 +1,44 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; +import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; + +/** + * Visitor used to visit query structure. + * + * @author cedric dumoulin + * + */ +public interface IQueryVisitor { + + public void visit( WindowTerm windowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window windowModel ); + public void visit( Folder folder, TabFolder folderModel ); + + public void visit(HSash sash, SashPanel sashModel); + public void visit(VSash sash, SashPanel sashModel); + + public void visit(Page page, PageRef pageModel) throws QueryException; + + /** + * If true, parent are visited before children. + * If false, parent are visited after children. + * @return + */ + public boolean isVisitingParentFirst(); + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/NoMatchException.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/NoMatchException.java new file mode 100644 index 00000000000..e8788b56156 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/NoMatchException.java @@ -0,0 +1,77 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +/** + * Exception thrown when a query part does not match a modelpart. + * + * @author cedric dumoulin + * + */ +public class NoMatchException extends QueryException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + */ + public NoMatchException() { + } + + /** + * Constructor. + * + * @param arg0 + */ + public NoMatchException(String arg0) { + super(arg0); + } + + /** + * Constructor. + * + * @param arg0 + */ + public NoMatchException(Throwable arg0) { + super(arg0); + } + + /** + * Constructor. + * + * @param arg0 + * @param arg1 + */ + public NoMatchException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + + /** + * Constructor. + * + * @param arg0 + * @param arg1 + * @param arg2 + * @param arg3 + */ + public NoMatchException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { + super(arg0, arg1, arg2, arg3); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Page.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Page.java new file mode 100644 index 00000000000..eba008268c6 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/Page.java @@ -0,0 +1,117 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; + +/** + * This represent a page in the Checker query. + * + * @author cedric dumoulin + * + */ +public class Page implements IQueryTerm { + + protected Object identifier; + + protected String name; + + /** + * Constructor. + * + */ + public Page() { + + } + + /** + * Constructor. + * + * @param identifier + */ + public Page(Object identifier) { + this.identifier = identifier; + } + + /** + * Constructor. + * + * @param name + * @param identifier + */ + public Page(String name) { + this.name = name; + this.identifier = name; + } + + /** + * Constructor. + * + * @param name + * @param identifier + */ + public Page(String name, Object identifier) { + this.name = name; + this.identifier = identifier; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm#accept(IQueryVisitor, EObject) + * + * @param visitor + * @throws QueryException + */ + public void accept(IQueryVisitor visitor, EObject modelObject) throws QueryException { + // Check associated model type + if(! (modelObject instanceof PageRef) ) { + throw new NoMatchException( this.toString() + " - Model object type does not match to PageRef" ); + } + PageRef pageRef = (PageRef)modelObject; + visitor.visit(this, pageRef); + } + + /** + * @return the identifier + */ + public Object getIdentifier() { + return identifier; + } + + /** + * @param identifier the identifier to set + */ + public void setIdentifier(Object identifier) { + this.identifier = identifier; + } + + /** + * @see java.lang.Object#toString() + * + * @return + */ + @Override + public String toString() { + + return "Page()"; + } + + /** + * @return the name + */ + public String getName() { + return name; + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/PanelTerm.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/PanelTerm.java new file mode 100644 index 00000000000..967998b9473 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/PanelTerm.java @@ -0,0 +1,76 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +import org.eclipse.emf.ecore.EObject; + +/** + * Common ancestor of Panel (Folder and Sash) in queries structure. + *
+ * This class can also be used a starting point of query expression (and so Folder, VSash and HSash). + * + * @author cedric dumoulin + * + */ +public abstract class PanelTerm implements IQueryExp { + + protected String name; + + + /** + * Constructor. + * + */ + public PanelTerm() { + // TODO Auto-generated constructor stub + } + + /** + * Constructor. + * + * @param name + */ + public PanelTerm(String name) { + this.name = name; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm#accept(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor, org.eclipse.emf.ecore.EObject) + * + * @param visitor + * @param panel + * @throws QueryException + */ + public void accept(IQueryVisitor visitor, EObject panel) + throws QueryException { + // TODO Auto-generated method stub + + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryException.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryException.java new file mode 100644 index 00000000000..52644437231 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryException.java @@ -0,0 +1,77 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +/** + * Root Exception of the query package + * + * @author cedric dumoulin + * + */ +public class QueryException extends Exception { + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + */ + public QueryException() { + } + + /** + * Constructor. + * + * @param arg0 + */ + public QueryException(String arg0) { + super(arg0); + } + + /** + * Constructor. + * + * @param arg0 + */ + public QueryException(Throwable arg0) { + super(arg0); + } + + /** + * Constructor. + * + * @param arg0 + * @param arg1 + */ + public QueryException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + + /** + * Constructor. + * + * @param arg0 + * @param arg1 + * @param arg2 + * @param arg3 + */ + public QueryException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { + super(arg0, arg1);//, arg2, arg3); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryVisitor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryVisitor.java new file mode 100644 index 00000000000..9a053915926 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/QueryVisitor.java @@ -0,0 +1,124 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; +import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; +import org.eclipse.papyrus.infra.core.sashwindows.di.Window; + +/** + * Visitor used to collect element in the model. + * Each element in the model associated with a{@link IQueryTerm} whose name is set is collectted. + * The collected element is then accessible from the result map, using the name set in the IQueryTerm. + * + * + * @author cedric dumoulin + * + */ +public class QueryVisitor implements IQueryVisitor { + + /** + * The result map. + */ + protected Mapresult = new HashMap(); + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) + * + * @param windowTerm + * @param windowModel + */ + public void visit(WindowTerm windowTerm, Window windowModel) { + collect( windowTerm, windowModel); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder, org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder) + * + * @param folder + * @param folderModel + */ + public void visit(Folder folder, TabFolder folderModel) { + collect(folder, folderModel); + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) + * + * @param sash + * @param sashModel + */ + public void visit(HSash sash, SashPanel sashModel) { + collect(sash, sashModel); + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) + * + * @param sash + * @param sashModel + */ + public void visit(VSash sash, SashPanel sashModel) { + collect(sash, sashModel); + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page, org.eclipse.papyrus.infra.core.sashwindows.di.PageRef) + * + * @param page + * @param pageModel + */ + public void visit(Page page, PageRef pageModel) { + collect(page, pageModel); + + } + + /** + * Add the element associated to the query to the result, if the query has a name. + * @param iQueryTerm + * @param element + */ + protected void collect( IQueryTerm iQueryTerm, Object element) { + + if( iQueryTerm.getName() == null) { + return; + } + + result.put(iQueryTerm.getName(), element); + } + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#isVisitingParentFirst() + * + * @return + */ + public boolean isVisitingParentFirst() { + return true; + } + + /** + * @return the result + */ + public Map getResult() { + return result; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQuery.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQuery.java new file mode 100644 index 00000000000..ab49a7b1002 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQuery.java @@ -0,0 +1,220 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +import java.util.Map; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.infra.core.sashwindows.di.AbstractPanel; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashWindowsMngr; +import org.eclipse.papyrus.infra.core.sashwindows.di.Window; + +/** + * Class used to check and query (from tests) the DiContentProvider. + *
+ * This class also provide a set of static constructor helping in writing query. + *
+ * Examples: + *
    + *
  • PanelTerm query = folder("a", page(), page() );
  • + *
  • query = hSash( folder( page("p1"), page() ), vSash("s2", folder( page() ), folder( page() )) );
  • + *
  • PanelTerm query = hSash( folder("f1", page("p1"), page("p2"), page("p3") ), folder("f2", page("p4") ) );
  • + *
  • + *
+ * @author cedric dumoulin + * + */ +public class SashModelQuery { + + /** + * Model to query. + */ + protected SashModel sashModel; + + /** + * Static constructor for {@link Page}. + * @return + */ + static public Page page() { + return new Page(); + } + + /** + * Static constructor for {@link Page}. + * @return + */ + static public Page page(String name) { + return new Page(name); + } + + /** + * Static constructor for {@link Folder}. + * @return + */ + static public Folder folder( Page ...pages ) { + return new Folder(pages); + } + + /** + * Static constructor for {@link Folder}. + * @return + */ + static public Folder folder( String name, Page ...pages ) { + return new Folder(name, pages); + } + + /** + * Static constructor for {@link VSash}. + * @return + */ + static public VSash vSash( String name, PanelTerm up, PanelTerm down) { + return new VSash(name, up, down); + } + + /** + * Static constructor for {@link VSash}. + * @return + */ + static public VSash vSash( PanelTerm up, PanelTerm down) { + return new VSash(up, down); + } + + /** + * Static constructor for {@link HSash}. + * @return + */ + static public HSash hSash( String name, PanelTerm left, PanelTerm right) { + return new HSash(name, left, right); + } + + /** + * Static constructor for {@link HSash}. + * @return + */ + static public HSash hSash( PanelTerm left, PanelTerm right) { + return new HSash(left, right); + } + + /** + * Constructor. + * + * @param modelMngr + */ + public SashModelQuery(SashWindowsMngr modelMngr) { + this.sashModel = modelMngr.getSashModel(); + } + + /** + * Constructor. + * + * @param sashModel + */ + public SashModelQuery(SashModel sashModel) { + this.sashModel = sashModel; + } + + + /** + * Check if the sashModel is conformed to the specified query. + * @param query + * @throws QueryException + */ + public void assertConform(IQueryExp query) throws QueryException { + + EObject first; + if( query instanceof WindowTerm) { + first = getFirstWindowModel(); + } + else if( query instanceof PanelTerm) { + first = getFirstPanelModel(); + } + else { + throw new QueryException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); + } + + CheckVisitor visitor = new CheckVisitor(); + query.accept(visitor, first); + } + + /** + * Create an internal model conform to the specified query. + * Any previous model is disguarded. + * + * @param query Should be a subtype PanelTerm (Folder, HSash, VSash) + * @throws QueryException + */ + public void createModel(IQueryExp query) throws QueryException { + + Window first; + if( query instanceof PanelTerm) { + first = getFirstWindowModel(); + } + else { + throw new QueryException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); + } + + // Create a surrounding WindowTerm + WindowTerm windowTerm = new WindowTerm((PanelTerm)query); + + CreateModelVisitor visitor = new CreateModelVisitor(); + windowTerm.accept(visitor, first); + } + + /** + * Get element in the model. + * Each model element whose corresponding model query part as a name is added to the result map. + * The element is then accessible with the name set in the query part. + * + * @param query + * @return + * @throws QueryException + */ + public Map queryModel(IQueryExp query) throws QueryException { + + EObject first; + if( query instanceof WindowTerm) { + first = getFirstWindowModel(); + } + else if( query instanceof PanelTerm) { + first = getFirstPanelModel(); + } + else { + throw new QueryException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); + } + + QueryVisitor visitor = new QueryVisitor(); + query.accept(visitor, first); + + return visitor.getResult(); + } + + /** + * Get the model of the first the first window (in actual implementation their is only one window). + * @return + */ + private Window getFirstWindowModel() { + return sashModel.getWindows().get(0); + } + + /** + * Get the panel of the first window (in actual implementation their is only one window). + * @return + */ + private AbstractPanel getFirstPanelModel() { + return sashModel.getWindows().get(0).getPanel(); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQueryTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQueryTest.java new file mode 100644 index 00000000000..9e041e633c1 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/SashModelQueryTest.java @@ -0,0 +1,194 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.folder; +import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.hSash; +import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.page; +import static org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQuery.vSash; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashWindowsMngr; +import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; +import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.junit.Test; + +/** + * Tests on SashModelQuery. + * Tests for the {@link SashModelQuery} implementation. This is not tests on SashModel + * + * @author dumoulin + * + */ +public class SashModelQueryTest extends AbstractPapyrusTest { + + /** + * Test query structure + */ + @Test + public void testQuery() { + + // Try to create a query + Folder folder = new Folder(new Page(), new Page()); + // Check if well constructed + assertEquals("Contain Two pages", 2, folder.getPages().size()); + + // Check sash + HSash hsash = new HSash(new Folder(new Page()), new Folder(new Page())); + assertNotNull("Folder set", hsash.getLeftup()); + assertNotNull("Folder set", hsash.getRightdown()); + } + + /** + * Test accept visitor. + * + * @throws QueryException + */ + @Test + public void testCreateModelFPP() throws QueryException { + + // Create a modelQuery + SashWindowsMngr diSashModel = DiUtils.createDefaultSashWindowsMngr(); + SashModelQuery modelQuery = new SashModelQuery(diSashModel); + + // Try to create a model + IQueryExp query = new Folder(new Page(), new Page()); + modelQuery.createModel(query); + + // Check creation + modelQuery.assertConform(query); + + // Other query + query = new HSash(new Folder(new Page(), new Page()), new Folder(new Page())); + modelQuery.createModel(query); + + // Check creation + modelQuery.assertConform(query); + + // ********************* + // Other query + query = new HSash(new Folder(new Page(), new Page()), new VSash(new Folder(new Page()), new Folder(new Page()))); + modelQuery.createModel(query); + + // Check creation + modelQuery.assertConform(query); + + + } + + /** + * Test accept visitor. + * + * @throws QueryException + */ + @Test + public void testQueriesWithResult() throws QueryException { + + // Create a modelQuery + SashWindowsMngr diSashModel = DiUtils.createDefaultSashWindowsMngr(); + SashModelQuery modelQuery = new SashModelQuery(diSashModel); + + // Try to create a model + IQueryExp query = new Folder("a", new Page(), new Page()); + modelQuery.createModel(query); + Map result = modelQuery.queryModel(query); + assertNotNull("folder found", result.get("a")); + + // Check creation + modelQuery.assertConform(query); + + // Other query + query = new HSash(new Folder(new Page(), new Page("p1")), new Folder("a", new Page())); + modelQuery.createModel(query); + + // Check creation + modelQuery.assertConform(query); + result = modelQuery.queryModel(query); + assertNotNull("folder found", result.get("a")); + assertTrue("right type", result.get("a") instanceof TabFolder); + assertNotNull("page found", result.get("p1")); + assertTrue("right type", result.get("p1") instanceof PageRef); + + // ********************* + // Other query + query = new HSash(new Folder(new Page(), new Page()), new VSash("s2", new Folder(new Page()), new Folder(new Page()))); + modelQuery.createModel(query); + + // Check creation + modelQuery.assertConform(query); + result = modelQuery.queryModel(query); + assertNotNull("sash found", result.get("s2")); + assertTrue("right type ", result.get("s2") instanceof SashPanel); + + + } + + /** + * Test accept visitor. + * + * @throws QueryException + */ + @Test + public void testStaticCreates() throws QueryException { + + // Create a modelQuery + SashWindowsMngr diSashModel = DiUtils.createDefaultSashWindowsMngr(); + SashModelQuery modelQuery = new SashModelQuery(diSashModel); + + // Try to create a model + IQueryExp query = folder("a", page(), page()); + modelQuery.createModel(query); + // Check creation + modelQuery.assertConform(query); + + // Other query + query = hSash(folder(page(), page("p1")), folder("f1", page())); + modelQuery.createModel(query); + + // Check creation + modelQuery.assertConform(query); + + // ********************* + // Other query + query = hSash(folder(page(), page()), vSash("s2", folder(page()), folder(page()))); + modelQuery.createModel(query); + + // Check creation + modelQuery.assertConform(query); + + } + + /** + * Test toString. + */ + @Test + public void testToString() { + + // Try to create a query + Folder folder = new Folder(new Page(), new Page()); + + assertEquals("String match", "Folder(Page(), Page())", folder.toString()); + + HSash sash = new HSash(folder, new Folder(new Page())); + assertEquals("String match", "HSash(Folder(Page(), Page()), Folder(Page()))", sash.toString()); + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/VSash.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/VSash.java new file mode 100644 index 00000000000..b449634d439 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/VSash.java @@ -0,0 +1,87 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; + +/** + * Class for structure representing vertical sash in Checker + * + * @author dumoulin + * + */ +public class VSash extends AbstractSash { + + /** + * Constructor. + * + * @param leftup + * @param rightdown + */ + public VSash(PanelTerm left, PanelTerm right) { + super(left, right); + } + + /** + * Constructor. + * + * @param leftup + * @param rightdown + */ + public VSash(String name, PanelTerm left, PanelTerm right) { + super(name, left, right); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm#accept(IQueryVisitor, EObject) + * + * @param visitor + * @throws QueryException + */ + public void accept(IQueryVisitor visitor, EObject modelObject) throws QueryException { + // Check associated model type + if(! (modelObject instanceof SashPanel) ) { + throw new NoMatchException( "Model object type does not match to SashPanel" ); + } + + SashPanel sashModel = (SashPanel)modelObject; + + // Visit this + if( visitor.isVisitingParentFirst() ) { + visitor.visit(this, sashModel); + } + + // Visit children + leftup.accept(visitor, sashModel.getChildren().get(0)); + rightdown.accept(visitor, sashModel.getChildren().get(1)); + + // Visit this + if( !visitor.isVisitingParentFirst() ) { + visitor.visit(this, sashModel); + } + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.AbstractSash#getStringName() + * + * @return + */ + @Override + protected String getStringName() { + return "VSash"; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/WindowTerm.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/WindowTerm.java new file mode 100644 index 00000000000..12f0cdbc314 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/sashmodel/query/WindowTerm.java @@ -0,0 +1,100 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.infra.core.sashwindows.di.Window; + +/** + * A term representing a Window in the query + * + * @author cedric dumoulin + * + */ +public class WindowTerm implements IQueryTerm { + + /** + * A window have only one panel. + */ + protected PanelTerm panel; + + protected String name; + + /** + * Constructor. + * + * @param panel + */ + public WindowTerm(PanelTerm panel) { + this.panel = panel; + } + + /** + * Constructor. + * + * @param name + * @param panel + */ + public WindowTerm(String name, PanelTerm panel) { + this.name = name; + this.panel = panel; + } + + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryTerm#accept(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor, org.eclipse.emf.ecore.EObject) + * + * @param visitor + * @param panel + * @throws QueryException + */ + public void accept(IQueryVisitor visitor, EObject model) throws QueryException { + + // Check associated model type + if(! (model instanceof Window) ) { + throw new NoMatchException( "Model object type does not match to Window" ); + } + + Window window = (Window)model; + + if( visitor.isVisitingParentFirst() ) { + visitor.visit(this, window); + } + // visit children + panel.accept(visitor, window.getPanel()); + + if( ! visitor.isVisitingParentFirst() ) { + visitor.visit(this, window); + } + + } + + + /** + * @return the panel + */ + public PanelTerm getPanel() { + return panel; + } + + + /** + * @return the name + */ + public String getName() { + return name; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/tests/AllTests.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/tests/AllTests.java new file mode 100644 index 00000000000..cc66d500988 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di.tests/test/org/eclipse/papyrus/infra/core/sasheditor/di/tests/AllTests.java @@ -0,0 +1,43 @@ +/***************************************************************************** + * Copyright (c) 2009 CEA LIST & LIFL + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.di.tests; + +import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelMngrTest; +import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.DiContentProvider2Test; +import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.DiContentProviderTest; +import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.PageManagerImplTest; +import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal.TransactionalDiContentProvider2Test; +import org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.SashModelQueryTest; +import org.junit.runner.RunWith; +import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; +import org.junit.runners.Suite.SuiteClasses; + +/** + * Test suite for this fragment + */ +@RunWith(ClassificationSuite.class) +@SuiteClasses({ + // package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider + DiSashModelMngrTest.class, + // package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal + DiContentProviderTest.class, + DiContentProvider2Test.class, + TransactionalDiContentProvider2Test.class, + PageManagerImplTest.class, + // package org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query + SashModelQueryTest.class +}) +public class AllTests { + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.classpath b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.classpath new file mode 100644 index 00000000000..969b4034060 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.project b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.project new file mode 100644 index 00000000000..03820d2e1f9 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.infra.core.sasheditor.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/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c585cc455ae --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.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.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 +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/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/.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/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..ff298d7c6f3 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/META-INF/MANIFEST.MF @@ -0,0 +1,31 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui.editors;bundle-version="3.8.0", + org.eclipse.jface.text;bundle-version="3.8.0", + org.eclipse.ui.ide;bundle-version="3.8.0", + org.eclipse.core.resources;bundle-version="3.8.0", + org.junit;bundle-version="4.10.0", + org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.2.0", + org.eclipse.ui;bundle-version="3.106.0", + org.eclipse.ui.workbench.texteditor;bundle-version="3.9.0", + org.eclipse.core.runtime;bundle-version="3.10.0", + org.eclipse.emf.ecore;bundle-version="2.11.0", + org.eclipse.papyrus.junit.framework;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.2.0" +Export-Package: org.eclipse.papyrus.infra.core.sasheditor.contentprovider, + org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple, + org.eclipse.papyrus.infra.core.sasheditor.editor, + org.eclipse.papyrus.infra.core.sasheditor.internal, + org.eclipse.papyrus.infra.core.sasheditor.pagesmodel, + org.eclipse.papyrus.infra.core.sasheditor.tests, + org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor, + org.eclipse.papyrus.infra.core.sasheditor.tests.utils, + org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak, + org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace, + org.eclipse.papyrus.infra.core.sasheditor.utils +Bundle-Vendor: %providerName +Bundle-Version: 1.2.0.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.infra.core.sasheditor.tests;singleton:=true +Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/about.html b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/about.html new file mode 100644 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/about.html @@ -0,0 +1,28 @@ + + + + +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/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/build.properties b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/build.properties new file mode 100644 index 00000000000..4cedaeae848 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/build.properties @@ -0,0 +1,8 @@ +source.. = test/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + org.eclipse.papyrus.infra.core.sasheditor.tests.launch,\ + plugin.properties,\ + about.html,\ + plugin.xml diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/org.eclipse.papyrus.infra.core.sasheditor.tests.launch b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/org.eclipse.papyrus.infra.core.sasheditor.tests.launch new file mode 100644 index 00000000000..7f1f30aa592 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/org.eclipse.papyrus.infra.core.sasheditor.tests.launch @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.properties b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.properties new file mode 100644 index 00000000000..71c09758d64 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.properties @@ -0,0 +1,13 @@ +################################################################################# +# Copyright (c) 2010 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=Papyrus Sash editor Tests Fragment +providerName=Eclipse Modeling Project + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.xml b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.xml new file mode 100644 index 00000000000..f4ffcab7f35 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/plugin.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/pom.xml b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/pom.xml new file mode 100644 index 00000000000..0920728f374 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + + org.eclipse.papyrus + org.eclipse.papyrus.tests.releng + 1.2.0-SNAPSHOT + ../../../../../../releng/main-tests + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.core.sasheditor.tests + 1.2.0-SNAPSHOT + eclipse-test-plugin + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/AbstractSashWindowContentProviderFacadeTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/AbstractSashWindowContentProviderFacadeTest.java new file mode 100644 index 00000000000..19eb3343010 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/AbstractSashWindowContentProviderFacadeTest.java @@ -0,0 +1,272 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider; + +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.folder; +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.page; +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.vSash; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; +import org.eclipse.swt.SWT; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + + +/** + * Test suite for {@link ISashWindowsContentProviderFacade} implementations. + * Each implementation of {@link ISashWindowsContentProviderFacade} can be tested with this suite. + * This class provides the tests common to all implementation. + * + * An implementation can be tested by subclassing this class, and by implementing the + * getIcontentProviderFacade method. This later should return the implementation of + * {@link ISashWindowsContentProviderFacade} to test. + * + * @author cedric dumoulin + * + */ +public abstract class AbstractSashWindowContentProviderFacadeTest { + + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + } + + /** + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + } + + /** + * Create an instance of the {@link ISashWindowsContentProviderFacade} to test. + * + * @return an instance of {@link ISashWindowsContentProviderFacade}; + */ + abstract public ISashWindowsContentProviderFacade createISashWindowsContentProviderFacade(); + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#assertConform(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. + * @throws PagesModelException + */ + @Test + public void testAssertConform() throws PagesModelException { + ISashWindowsContentProviderFacade helper = createISashWindowsContentProviderFacade(); + + assertNotNull("helper created", helper); + // Create a query + IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); + // Try to create the model + helper.createModel(expr); + + // Try to check model + helper.assertConform(expr); + + } + + /** + * Test assertConform with expr starting with a folder. + * @throws PagesModelException + */ + @Test + public void testAssertConformExprStartngWithFolder() throws PagesModelException { + ISashWindowsContentProviderFacade helper = createISashWindowsContentProviderFacade(); + + assertNotNull("helper created", helper); + // Create a query + IModelExp expr = folder( "f1", page("p1"), page("p2"), page("p3"), page("p4"), + page("p5"), page("p6"), page("p7"), page("p8")); + // Try to create the model + helper.createModel(expr); + + + // Check if conform + helper.assertConform(expr); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#createModel(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. + * @throws PagesModelException + */ + @Test + public void testCreateModel() throws PagesModelException { + ISashWindowsContentProviderFacade helper = createISashWindowsContentProviderFacade(); + + assertNotNull("helper created", helper); + // Create a query + IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); + // Try to create the model + helper.createModel(expr); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#queryModel(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. + * @throws PagesModelException + */ + @Test + public void testQueryModel() throws PagesModelException { + ISashWindowsContentProviderFacade helper = createISashWindowsContentProviderFacade(); + + assertNotNull("helper created", helper); + // Create a query + IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); + // Try to create the model + helper.createModel(expr); + + // Query model + Map res = helper.queryModel(expr); + assertNotNull("found f1", res.get("f1")); +// assertTrue("right type", res.get("f1") instanceof TabFolderModel ); + + assertNotNull("found f2", res.get("f2")); +// assertTrue("right type", res.get("f2") instanceof TabFolderModel ); + + assertNotNull("found p2", res.get("p2")); +// assertTrue("right type", res.get("p2") instanceof IPageModel ); + } + + /** + * Test folder creation. + * Use the pagemodels utilities {@link SimpleSashWindowContentProviderUtils}. + * @throws PagesModelException + */ + @Test + public void testCreateFolder() throws PagesModelException { + + + ISashWindowsContentProviderFacade contentFacade = createISashWindowsContentProviderFacade(); + + assertNotNull("helper created", contentFacade); + // Create a query +// IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); + IModelExp expr = folder( "f1", page("p1"), page("p2"), page("p3"), page("p4"), + page("p5"), page("p6"), page("p7"), page("p8")); + // Try to create the model + contentFacade.createModel(expr); + + // Create another folder + contentFacade.createFolder("f1", 0, "f1", SWT.UP); + // Check the content configuration + IModelExp conf1Expr = vSash( + folder( "f2", page("p1") ), + folder( "f1", page("p2"), page("p3"), page("p4"), + page("p5"), page("p6"), page("p7"), page("p8") ) + ); + // Check if conform + contentFacade.assertConform(conf1Expr); + + // Check resetContext + contentFacade.resetNamesContext(conf1Expr); + + assertNotNull("new name found", contentFacade.getNamesToInternalMap().get("f2")); + } + + + /** + * Test page creation. + * @throws PagesModelException + */ + @Test + public void testCreateNewPage() throws PagesModelException { + ISashWindowsContentProviderFacade helper = createISashWindowsContentProviderFacade(); + + assertNotNull("helper created", helper); + // Create a query + IModelExp expr = folder( "f1", page("p1"), page("p2"), page("p3"), page("p4"), + page("p5"), page("p6"), page("p7"), page("p8")); + // Try to create the model + helper.createModel(expr); + + // Create a new page + helper.addPage(page("newPage"), "f1"); + + // Check the content configuration + IModelExp conf1Expr = folder( "f1", page("p1"), page("p2"), page("p3"), page("p4"), + page("p5"), page("p6"), page("p7"), page("p8"), page("newPage")); + + // Check if conform + helper.assertConform(conf1Expr); + + } + + /** + * Test page deletion. + * @throws PagesModelException + */ + @Test + public void testClosePage() throws PagesModelException { + ISashWindowsContentProviderFacade helper = createISashWindowsContentProviderFacade(); + + assertNotNull("helper created", helper); + // Create a query + IModelExp expr = folder( "f1", page("p1"), page("p2"), page("p3"), page("p4"), + page("p5"), page("p6"), page("p7"), page("p8")); + // Try to create the model + helper.createModel(expr); + + // Create a new page + helper.removePage( "p8"); + + // Check the content configuration + IModelExp conf1Expr = folder( "f1", page("p1"), page("p2"), page("p3"), page("p4"), + page("p5"), page("p6"), page("p7")); + + // Check if conform + helper.assertConform(conf1Expr); + + } + + /** + * Test folder deletion. + * Use the pagemodels utilities {@link SimpleSashWindowContentProviderUtils}. + * @throws PagesModelException + */ + @Test + public void testDeleteFolder() throws PagesModelException { + + + ISashWindowsContentProviderFacade contentFacade = createISashWindowsContentProviderFacade(); + + assertNotNull("helper created", contentFacade); + // Create a query +// IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); + IModelExp expr = vSash( + folder( "f1", page("p2"), page("p3"), page("p4") ), + folder( "f2", page("p1") ) + ); + // Try to create the model + contentFacade.createModel(expr); + + // Create the folder. + // This is done by closing the last page + contentFacade.removePage("p1"); + + // Check the content configuration + IModelExp conf1Expr = folder( "f1", page("p2"), page("p3"), page("p4")); + // Check if conform + contentFacade.assertConform(conf1Expr); + + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/IPageMngrTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/IPageMngrTest.java new file mode 100644 index 00000000000..73ae5b404ea --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/IPageMngrTest.java @@ -0,0 +1,58 @@ +/** + * + */ +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider; + +import junit.framework.TestCase; + +import org.junit.After; +import org.junit.Before; + + +/** + * Base class for testing real implementation of ContentProvider. + * Real implementation should subclass this class, and implement the create method. + * + * @author cedric dumoulin + * + */ +public abstract class IPageMngrTest extends TestCase { + + /** + * The public API allowing to access to the implementation. + */ + protected ISashWindowsContentProvider contentProvider; + + /** + * The public API allowing to access to the implementation. + */ + // protected IPageMngr pageMngr; + + /** + * Setup the test. + * + * @see junit.framework.TestCase#setUp() + * + * @throws Exception + */ + @Before + @Override + protected void setUp() throws Exception { + // TODO Auto-generated method stub + super.setUp(); + } + + @After + @Override + protected void tearDown() throws Exception { + // TODO Auto-generated method stub + super.tearDown(); + } + + /** + * Test that the pageIdentifier passed to addPAge() is provided back from {@link ISashWindowsContainer#getActiveEditor()()} + */ + public void testAddPage() { + + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/ISashWindowsContentProviderFacade.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/ISashWindowsContentProviderFacade.java new file mode 100644 index 00000000000..99fc3632b88 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/ISashWindowsContentProviderFacade.java @@ -0,0 +1,220 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider; + +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IAbstractPanelModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NotFoundException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; + + +/** + * Interface providing a common facade to test the {@link ISashWindowsContentProvider} implementations. + *
+ * This facade provides methods to manipulate {@link ISashWindowsContentProvider} with + * the help of names. Each element in the {@link SimpleSashWindowsContentProvider} can be identified + * by a name (String). Then, the facade provide methods similar to {@link ISashWindowsContentProvider}, but using + * names rather than {@link IAbstractPanelModel} and {@link ITabFolderModel}. + *
+ * The facade maintains a mapping between the names and the {@link ISashWindowsContentProvider} models. + + *
+ * Implementations of this class + * allow to create an internal model according to a provided {@link IModelExp}. It is also possible + * to check if the internal model is conform to the {@link IModelExp}. + * + *
+ * There is several {@link ISashWindowsContentProvider} implementations, but a lot of tests are commons to + * all the implementations. The interface allows to develop common tests regardless of the real implementation. + *
+ * One develop common tests using {@link ISashWindowsContentProvider} and {@link ISashWindowsContentProviderFacade}. Then, + * this test is subclassed and the appropriate implementations are specified in the subclasses. + * + * + * @author cedric dumoulin + * + */ +public interface ISashWindowsContentProviderFacade { + + /** + * Create an internal model conform to the specified query. + * Any previous model is disguarded. + * + * Some implementations do not allow to call this method more than once. In this case, + * the implementation should throw an Exception. + * + * @param query Should be a subtype PanelTerm (Folder, HSash, VSash) + * @throws QueryException + * + */ + public abstract void createModel(IModelExp query) throws PagesModelException; + + /** + * Check if the internal model is conformed to the specified query. + * @param query + * @throws QueryException + */ + public abstract void assertConform(IModelExp query) throws PagesModelException; + + /** + * Get element in the model. + * Each model element whose corresponding model query part as a name is added to the result map. + * The element is then accessible with the name set in the query part. + * + * @param query + * @return + * @throws QueryException + */ + public abstract Map queryModel(IModelExp query) throws PagesModelException; + + /** + * Get the {@link ISashWindowsContentProvider} associated to this utility class. + * @return + */ + public ISashWindowsContentProvider getIContentProvider(); + + /** + * Add a page at the specified index of TabFolder. + *
+ * This method is not used by the {@link ISashWindowsContainer}. + * + * @param page + * An object identifying the page to add. The object could be anything. It will be + * passed to the {@link ITabFolderModel#createChildSashModel(Object)} method. + * @param index + * Index to where the tabItem should be added. + * @throws NotFoundException + */ + public void /*IPageModel*/ addPage(Page page, String folderName, int index) throws PagesModelException; + + /** + * Add a page at the end of TabFolder. + *
+ * This method is not used by the {@link ISashWindowsContainer}. + * + * @param page + * An object identifying the page to add. The object could be anything. It will be + * passed to the {@link ITabFolderModel#createChildSashModel(Object)} method. + * @return + * @throws NotFoundException + */ + public void /*IPageModel*/ addPage(Page page, String folderName) throws PagesModelException; + + /** + * Move a tab inside the specified folder. + * + * @param model + * @param oldIndex + * @param newIndex + * @throws NotFoundException + */ + public void movePage(String folderName, int oldIndex, int newIndex) throws NotFoundException; + + /** + * Move a tab from folder to folder. + * + * @param model + * @param sourceIndex + * @param model2 + * @param targetIndex + */ + public void movePage(String srcFolderName, int sourceIndex, String targetFolderName, int targetIndex) throws NotFoundException; + + /** + * Remove the page from the sashes window. + * Look for the folder containing the page. + * + * @param page + * The Object identifying the page. This is the object used in {@link #addPage(Object)}. + */ + public void removePage(String pageName) throws NotFoundException; + + /** + * Remove the specified page from the parentFolder. + * + * @param tabItem + */ + public void removePage(String folderName, int tabIndex) throws NotFoundException; + + /** + * Ask the model to move the specified tab to the specified side of the specified targetFolder. + * This method + * is called by the the SashTileContainer when the user + * have drag a tab in a correct place. The SashTileContainer has not change is presentation yet. This + * will be done when the corresponding event will occur. + * + * @param tabFolder + * The folder containing the tab to move + * @param tabIndex + * The index of the tab to move + * @param targetFolder + * The folder to which the side refer to + * @param side + * Side where node should be inserted : SWT.LEFT, SWT.RIGHT, SWT.TOP, SWT.DOWN. + * @throws PagesModelException + */ + public void createFolder(String tabFolder, int tabIndex, String targetFolder, int side) throws PagesModelException; + + /** + * + * Reset the namesMapping context accordingly to the provided expr. + * The names mapping is used to lookup Model element by there name. + * The name mapping should be reset when the internal structure has change, + * and especially when an element is added. + *
+ * Reseting the names context allows to remove or add names to the context. + * It is used to add names of newly created elements (created with addPage() or createFolder() ) + + * @param expr + * @throws PagesModelException + */ + public void resetNamesContext(IModelExp expr) throws PagesModelException; + + /** + * A facade is associated to a names and internal models map that is internally used + * to lookup elements. + * This maps is reset with {@link #resetNamesContext(IModelExp)} + * @return The names to internal maps. + */ + public Map getNamesToInternalMap(); + + /** + * Ask the model to move the specified tab to the specified side of the specified targetFolder. + * This method + * is called by the the SashTileContainer when the user + * have drag a tab in a correct place. The SashTileContainer has not change is presentation yet. This + * will be done when the corresponding event will occur. + * + * @param tabFolder + * The folder containing the tab to move + * @param tabIndex + * The index of the tab to move + * @param targetFolder + * The folder to which the side refer to + * @param side + * Side where node should be inserted : SWT.LEFT, SWT.RIGHT, SWT.TOP, SWT.DOWN. + * @throws PagesModelException + */ +// public void createFolder(String newFolderName, String tabFolder, int tabIndex, String targetFolder, int side) throws PagesModelException; + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/AllTests.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/AllTests.java new file mode 100644 index 00000000000..d0419df3d64 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/AllTests.java @@ -0,0 +1,26 @@ +/***************************************************************************** + * Copyright (c) 2010 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 + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; + +import org.junit.runner.RunWith; +import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; +import org.junit.runners.Suite.SuiteClasses; + + +/** + * All tests for package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple + */ +@RunWith(ClassificationSuite.class) +@SuiteClasses({ SimpleSashWindowsContentProviderTest.class }) +public class AllTests { + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CheckVisitor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CheckVisitor.java new file mode 100644 index 00000000000..2acf33b4c6e --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CheckVisitor.java @@ -0,0 +1,109 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NoMatchException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; + + +/** + * @author cedric dumoulin + * + */ +public class CheckVisitor extends SimpleContentProviderBaseVisitor implements IPagesModelVisitor { + + /** + * @return the isVisitingParentFirst + */ + @Override + public boolean isVisitingParentFirst() { + return false; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) + * + * @param windowTerm + * @param windowModel + */ + @Override + public void visit(WindowTerm windowTerm, RootModel windowModel) { + // TODO Auto-generated method stub + + } + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder) + * + * @param folder + */ + @Override + public void visit(Folder folder, TabFolderModel folderModel) { + // Check name + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash) + * + * @param sash + */ + @Override + public void visit(HSash sash, SashPanelModel sashModel) { + // TODO Auto-generated method stub + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash) + * + * @param sash + */ + @Override + public void visit(VSash sash , SashPanelModel sashModel) { + // TODO Auto-generated method stub + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page) + * + * @param page + * @throws NoMatchException + */ + @Override + public void visit(Page page, IPageModel pageModel) throws PagesModelException { + //check name + if(page.getIdentifier() != null) { + checkName(page.getIdentifier(), pageModel.getTabTitle()) ; + } + else if(page.getName() != null) { + checkName(page.getName(), pageModel.getTabTitle()) ; + } + } + + + protected void checkName( Object expectedName, Object foundName) throws NoMatchException { + if( expectedName != foundName ) + throw new NoMatchException( "Names do not match (expected=" + + expectedName + ", found="+ foundName ); + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CreateModelInSimpleContentProviderVisitor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CreateModelInSimpleContentProviderVisitor.java new file mode 100644 index 00000000000..bcee016650c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/CreateModelInSimpleContentProviderVisitor.java @@ -0,0 +1,157 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.AbstractPanelModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SashPanelModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.TabFolderModel; +import org.eclipse.papyrus.infra.core.sasheditor.editor.MessagePartModel; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PanelTerm; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; +import org.eclipse.swt.SWT; + +/** + * This visitor is used with {@link IModelExp} to create a pages model in a {@link SimpleContentProvider} instancied + * with the Sash, folders and pages specified in the expr. + * + * + * @author cedric dumoulin + * + */ +public class CreateModelInSimpleContentProviderVisitor extends SimpleContentProviderBaseVisitor implements IPagesModelVisitor { + + /** + * {@link SimpleSashWindowsContentProvider} into which model is created. + */ + private SimpleSashWindowsContentProvider contentProvider; + + /** + * Constructor. + * + * @param contentProvider + */ + public CreateModelInSimpleContentProviderVisitor(SimpleSashWindowsContentProvider contentProvider) { + this.contentProvider = contentProvider; + } + + /** + * @return the isVisitingParentFirst + */ + public boolean isVisitingParentFirst() { + return true; + } + + /** + * There is no windowTerm counterpart in {@link SimpleSashWindowsContentProvider}. + * @param windowTerm + * @param windowModel + */ + @Override + public void visit(WindowTerm windowTerm, RootModel windowModel) { + // Create children of the window + PanelTerm panel = windowTerm.getPanel(); + + AbstractPanelModel childPanel = createPanelOrFolder(panel, windowModel); + windowModel.replaceChild(windowModel.getChild(), childPanel); + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder, org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder) + * + * @param folder + * @param folderModel + */ + @Override + public void visit(Folder folder, TabFolderModel folderModel) { + + // Create children of the folder + for( Page page : folder.getPages() ) { + // Create a page of type "MessagePartModel". + folderModel.getChildren().add( new MessagePartModel( page.getName(), page.getName() )); + } + + } + + /** + * + * @param sashQuery + * @param sashModel + */ + public void visit(HSash sashQuery, SashPanelModel sashModel) { + + // Create children of the sash + AbstractPanelModel leftChild = createPanelOrFolder(sashQuery.getLeftup(), sashModel); + sashModel.setLeftChild( leftChild ) ; + AbstractPanelModel rightChild = createPanelOrFolder(sashQuery.getRightdown(), sashModel); + sashModel.setRightChild(rightChild); + } + + /** + * @param sashModel + * @param panel + */ + private AbstractPanelModel createPanelOrFolder(PanelTerm panel, AbstractModel parent ) { + if(panel instanceof HSash) { + // Create a sash with null children. + // This is not a good example of how to proceed. Avoid to use it like this. + // Here we can do this because we know that we create the children soon. + return new SashPanelModel(parent, null, null, SWT.HORIZONTAL); + } + else if(panel instanceof VSash) { + return new SashPanelModel(parent, null, null, SWT.VERTICAL); + } + else /*if (panel instanceof Folder)*/ { + TabFolderModel folder = new TabFolderModel(contentProvider); + folder.setParent(parent); + return folder; + } + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) + * + * @param sash + * @param sashModel + */ + public void visit(VSash sashQuery, SashPanelModel sashModel) { + // Create children of the sash + AbstractPanelModel leftChild = createPanelOrFolder(sashQuery.getLeftup(), sashModel); + sashModel.setLeftChild( leftChild ) ; + AbstractPanelModel rightChild = createPanelOrFolder(sashQuery.getRightdown(), sashModel); + sashModel.setRightChild(rightChild); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page, org.eclipse.papyrus.infra.core.sashwindows.di.PageRef) + * + * @param page + * @param pageModel + */ + public void visit(Page page, IPageModel pageModel) { + // Page is created and identifier already set. + // Nothing to do + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/FakePageModel.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/FakePageModel.java new file mode 100644 index 00000000000..e3b72e57d75 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/FakePageModel.java @@ -0,0 +1,69 @@ +/***************************************************************************** + * Copyright (c) 2009, 2014 LIFL, 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: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * Christian W. Damus (CEA) - bug 392301 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.swt.graphics.Image; + + +/** + * A fake page for testing purpose + * + * @author dumoulin + */ +public class FakePageModel implements IPageModel { + + String title; + + static int count = 0; + + public FakePageModel() { + title = "noname" + count++; + } + + /** + * @param title + */ + public FakePageModel(String title) { + this.title = title; + } + + /** + * {@inheritDoc} + */ + public Object getRawModel() { + return this; + } + + /** + * {@inheritDoc} + */ + public Image getTabIcon() { + // TODO Auto-generated method stub + return null; + } + + /** + * {@inheritDoc} + */ + public String getTabTitle() { + // TODO Auto-generated method stub + return null; + } + + public void dispose() { + // Pass + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/QueryVisitor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/QueryVisitor.java new file mode 100644 index 00000000000..3773db2b87f --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/QueryVisitor.java @@ -0,0 +1,134 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelObject; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; + +/** + * Visitor used to collect element in the model. + * Each element in the model associated with a{@link IQueryTerm} whose name is set is collectted. + * The collected element is then accessible from the result map, using the name set in the IQueryTerm. + * + * + * @author cedric dumoulin + * + */ +public class QueryVisitor extends SimpleContentProviderBaseVisitor implements IPagesModelVisitor { + + /** + * The result map. + */ + protected Mapresult = new HashMap(); + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.WindowTerm, org.eclipse.papyrus.infra.core.sashwindows.di.Window) + * + * @param windowTerm + * @param windowModel + */ + @Override + public void visit(WindowTerm windowTerm, RootModel windowModel) { + collect( windowTerm, windowModel); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Folder, org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder) + * + * @param folder + * @param folderModel + */ + @Override + public void visit(Folder folder, TabFolderModel folderModel) { + collect(folder, folderModel); + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.HSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) + * + * @param sash + * @param sashModel + */ + @Override + public void visit(HSash sash, SashPanelModel sashModel) { + collect(sash, sashModel); + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.VSash, org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel) + * + * @param sash + * @param sashModel + */ + @Override + public void visit(VSash sash, SashPanelModel sashModel) { + collect(sash, sashModel); + + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#visit(org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.Page, org.eclipse.papyrus.infra.core.sashwindows.di.PageRef) + * + * @param page + * @param pageModel + */ + @Override + public void visit(Page page, IPageModel pageModel) { + collect(page, pageModel); + + } + + /** + * Add the element associated to the query to the result, if the query has a name. + * @param iQueryTerm + * @param element + */ + protected void collect( IModelObject iQueryTerm, Object element) { + + if( iQueryTerm.getName() == null) { + return; + } + + result.put(iQueryTerm.getName(), element); + } + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.IQueryVisitor#isVisitingParentFirst() + * + * @return + */ + @Override + public boolean isVisitingParentFirst() { + return true; + } + + /** + * @return the result + */ + public Map getResult() { + return result; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleContentProviderBaseVisitor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleContentProviderBaseVisitor.java new file mode 100644 index 00000000000..2879acc4191 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleContentProviderBaseVisitor.java @@ -0,0 +1,316 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; + +import java.util.Iterator; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.AbstractPanelModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.RootModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SashPanelModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.TabFolderModel; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Folder; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NoMatchException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModel; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; +import org.eclipse.swt.SWT; + +/** + * A base implementation of {@link IPagesModelVisitor} to visit conjointly SashPagesModel and + * SimpleContentProvider. + * + * This implementation separate the navigation part (walk(term, contentProviderModel)) and + * the visit part (visit(term, contentProviderModel)). It implements the navigation part. + *
+ * The visit part should be implemented by subclasses. + * + * + * + * @author cedric dumoulin + * + */ +public class SimpleContentProviderBaseVisitor implements IPagesModelVisitor { + + /** + * @return the isVisitingParentFirst + */ + public boolean isVisitingParentFirst() { + return true; + } + + /** + * Visit the model. Actually, there is no counterpart for {@link SashPagesModel} in {@link SimpleContentProvider}. + * + * @param windowTerm + * @param windowModel + * @throws PagesModelException + */ + public void walk(SashPagesModel pagesModel, Object contentProviderModel) throws PagesModelException { + // Check associated model type + if(! (contentProviderModel instanceof SimpleSashWindowsContentProvider) ) { + throw new NoMatchException( "ContentProvider type ("+ contentProviderModel.getClass().getName()+ ") does not match to WindowTerm" ); + } + + SimpleSashWindowsContentProvider contentProvider = (SimpleSashWindowsContentProvider)contentProviderModel; + + if( isVisitingParentFirst() ) { + visit(pagesModel, contentProvider); + } + // visit children + for( WindowTerm windowTerm : pagesModel.getWindows() ) { + // Only one window + RootModel windowModel = (RootModel) ((AbstractPanelModel)contentProvider.getRootModel()).getParent(); + windowTerm.getPanel().accept(this, windowModel); + } + if( ! isVisitingParentFirst() ) { + visit(pagesModel, contentProvider); + } + } + + /** + * Walk the WindowTerm and its child. + * @param windowTerm + * @param windowModel + * @throws PagesModelException + */ + public void walk(WindowTerm windowTerm, Object windowModel) throws PagesModelException { + // Check associated model type + if(! (windowModel instanceof RootModel) ) { + throw new NoMatchException( "ContentProvider type ("+ windowModel.getClass().getName()+ ") does not match to WindowTerm" ); + } + + RootModel window = (RootModel)windowModel; + + if( isVisitingParentFirst() ) { + visit(windowTerm, window); + } + // visit children + windowTerm.getPanel().accept(this, window.getChild()); + + if( ! isVisitingParentFirst() ) { + visit(windowTerm, window); + } + } + + /** + * Walk folder and its children. + * + * @param folder + * @param folderModel + * @throws PagesModelException + */ + public void walk(Folder folder, Object model) throws PagesModelException { + // Check associated model type + if(! (model instanceof TabFolderModel) ) { + throw new NoMatchException( this.toString() + + "\n" + folder + + "\n - Model object type does not match to FolderQueryPart." + + " Expected TabFolderModel, found '" + model.getClass().getSimpleName() + "'." + + " (" + folder.getName() +")" ); + } + TabFolderModel folderModel = (TabFolderModel)model; + + // Visit this + if( isVisitingParentFirst() ) { + visit(folder, folderModel); + } + + // visit children + Iterator pageRefs = folderModel.getChildren().iterator(); + Iterator pageQueries = folder.getPages().iterator(); + while (pageRefs.hasNext() && pageQueries.hasNext() ) { + IPageModel pageRef = pageRefs.next(); + Page query = pageQueries.next(); + + query.accept(this, pageRef); + } + if (pageRefs.hasNext()) { + // some page left + throw new NoMatchException( "Folder matching - " + + this.toString() + +" folder model have more pages than folder query. ("+folder.getName()+")" ); + } else if (pageQueries.hasNext() ) { + // some queries left + throw new NoMatchException( "Folder matching - " + + this.toString() + +" folder query have more page than folder model. ("+folder.getName()+")" ); + } + // Visit this + if( ! isVisitingParentFirst() ) { + visit(folder, folderModel); + } + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor#walk(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.HSash, java.lang.Object) + * + * @param sash + * @param sashModel + * @throws PagesModelException + */ + public void walk(HSash sash, Object model) throws PagesModelException { + // Check associated model type + if(! (model instanceof SashPanelModel) ) { + throw new NoMatchException( this.toString() + " - Model object type does not match to SashPanel (found " + + model.getClass() + + " )"); + } + + SashPanelModel sashModel = (SashPanelModel)model; + + // Check orientation + if( sashModel.getSashDirection() != SWT.HORIZONTAL) { + throw new NoMatchException( this.toString() + " - SashOrientation does not match 'HORIZONTAL'" ); + } + // Visit this + if( isVisitingParentFirst() ) { + visit(sash, sashModel); + } + + // Visit children + sash.getLeftup().accept(this, sashModel.getChildren().get(0)); + sash.getRightdown().accept(this, sashModel.getChildren().get(1)); + + if( !isVisitingParentFirst() ) { + visit(sash, sashModel); + } + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IPagesModelVisitor#walk(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.VSash, java.lang.Object) + * + * @param sash + * @param sashModel + * @throws PagesModelException + */ + public void walk(VSash sash, Object model) throws PagesModelException { + // Check associated model type + if(! (model instanceof SashPanelModel) ) { + throw new NoMatchException( this.toString() + " - Model object type does not match to SashPanel (found " + + model.getClass() + + " )"); + } + + SashPanelModel sashModel = (SashPanelModel)model; + + // Check orientation + if( sashModel.getSashDirection() != SWT.VERTICAL) { + throw new NoMatchException( this.toString() + " - SashOrientation does not match 'VERTICAL'" ); + } + // Visit this + if( isVisitingParentFirst() ) { + visit(sash, sashModel); + } + + // Visit children + sash.getLeftup().accept(this, sashModel.getChildren().get(0)); + sash.getRightdown().accept(this, sashModel.getChildren().get(1)); + + if( !isVisitingParentFirst() ) { + visit(sash, sashModel); + } + } + + /** + * Walk the page. Simply call the corresponding {@link SimpleContentProviderBaseVisitor#visit(Page, IPageModel)} method. + * @param page + * @param pageModel + * @throws PagesModelException + */ + public void walk(Page page, Object model) throws PagesModelException { + // Check associated model type + if(! (model instanceof IPageModel) ) { + throw new NoMatchException( this.toString() + " - Model object type does not match to PageRef" ); + } + IPageModel pageModel = (IPageModel)model; + visit(page, pageModel); + } + + + /** + * Visit the model. Actually, there is no counterpart for {@link SashPagesModel} in {@link SimpleContentProvider}. + * + * @param windowTerm + * @param windowModel + * @throws PagesModelException + */ + public void visit(SashPagesModel pagesModel, Object windowModel) throws PagesModelException { + + } + + /** + * Visit the corresponding node. + * To be implemented by subclass. + * + * + * @param windowTerm + * @param windowModel + */ + public void visit(WindowTerm windowTerm, RootModel windowModel) throws PagesModelException { + // To be implemented by subclass. + } + + /** + * Visit the corresponding node. + * To be implemented by subclass. + * + * @param folder + * @param folderModel + */ + public void visit(Folder folder, TabFolderModel folderModel) throws PagesModelException{ + + } + + /** + * Visit the corresponding node. + * To be implemented by subclass. + * + * @param sashQuery + * @param sashModel + */ + public void visit(HSash sashQuery, SashPanelModel sashModel) throws PagesModelException { + + } + + /** + * Visit the corresponding node. + * To be implemented by subclass. + * + * + * @param sash + * @param sashModel + */ + public void visit(VSash sashQuery, SashPanelModel sashModel) throws PagesModelException{ + } + + /** + * Visit the corresponding node. + * To be implemented by subclass. + * + * + * @param page + * @param pageModel + */ + public void visit(Page page, IPageModel pageModel) throws PagesModelException { + + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacade.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacade.java new file mode 100644 index 00000000000..b5ea7881d7e --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacade.java @@ -0,0 +1,452 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; + +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IAbstractPanelModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; +import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer; +import org.eclipse.papyrus.infra.core.sasheditor.editor.MessagePartModel; +import org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.BadNameException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NotFoundException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PanelTerm; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; + +/** + * Class providing a facade to test the {@link SashWindowsContainer} class. + *
+ * This facade own a {@link SimpleSashWindowsContentProvider}, a {@link SashWindowsContainer} and + * provides methods to manipulate it with the help of names. + *
+ * The facade allows to create pages and folders in the sashContainer, thru the ContentProvider. + * It also allows to check the resulting structure inside the SashContainer. + * The facade can also be used to create a particular configuration of the SashContainer, and apply + * tests on this configuration. + *
+ * Each element in the {@link SimpleSashWindowsContentProvider} can be identified + * by a name (String). Then, the facade provide methods similar to {@link ISashWindowsContentProvider}, but using + * names rather than {@link IAbstractPanelModel} and {@link ITabFolderModel}. + *
+ * The facade maintains a mapping between the names and the {@link ISashWindowsContentProvider} models. + *
+ * The + * @author cedric dumoulin + * + */ +public class SimpleSashWindowContainerTestFacade implements ISashWindowsContentProviderFacade { + + /** + * The internal content provider this facade is for. + */ + protected SimpleSashWindowsContentProvider contentProvider; + + /** + * The associated SashContainer + */ + protected SashWindowsContainer sashContainer; + /** + * Display used to create windows. + */ + protected Display display; + + + /** + * Mapping between names provided in the expressions and internal implementations of the {@link SimpleSashWindowsContentProvider}. + * This mapping is maintained when elements are added or removed. + * + */ + protected Map namesMapping; + + /** + * Constructor. + * Create a default internal {@link SimpleSashWindowsContentProvider}; + * @param modelMngr + */ + public SimpleSashWindowContainerTestFacade() { + this.contentProvider = new SimpleSashWindowsContentProvider(); + initDisplay(); + sashContainer = createSashWindowsContainer(contentProvider); + } + + /** + * Constructor. + * + * @param modelMngr + */ + public SimpleSashWindowContainerTestFacade(SimpleSashWindowsContentProvider contentProvider) { + this.contentProvider = contentProvider; + initDisplay(); + sashContainer = createSashWindowsContainer(contentProvider); + } + + /** + * Init the display object. + */ + protected void initDisplay() { + display = Display.getCurrent(); + if(display == null) { + display = new Display(); + } + } + /** + * Create a {@link SashWindowsContainer} to test. Initialize it with provided {@link ISashWindowsContentProvider}. + * + * @param contentProvider + * @return + */ + protected SashWindowsContainer createSashWindowsContainer(ISashWindowsContentProvider contentProvider) { + Shell shell = new Shell(display); + shell.setLayout(new FillLayout()); + + // + //new ShellEditor(shell); + SashWindowsContainer sashWindowContainer = new SashWindowsContainer(); + + sashWindowContainer.setContentProvider(contentProvider); + + sashWindowContainer.createPartControl(shell); + // shell.open(); + return sashWindowContainer; + } + + + /** + * @return the sashContainer + */ + public SashWindowsContainer getSashContainer() { + return sashContainer; + } + + /** + * @return the ISashWindowsContainer interface + */ + public ISashWindowsContainer getISashWindowsContainer() { + return sashContainer; + } + + /** + * @return the contentProvider + */ + public ISashWindowsContentProvider getIContentProvider() { + return contentProvider; + } + + /** + * Dispose the facade + */ + public void dispose() { + sashContainer.dispose(); + // display.dispose(); + if(namesMapping != null) { + namesMapping.clear(); + } + contentProvider = null; + sashContainer = null; + } + + /** + * Reset the namesMapping context accordingly to the provided expr. + * A side effect is that the internal structure is checked against the expr. + *
+ * Reseting the names context allows to remove or add names to the context. + * It is used to add names of newly created elements (created with addPage() or createFolder() ) + + * @param expr + * @throws PagesModelException + */ + public void resetNamesContext(IModelExp expr) throws PagesModelException { + namesMapping = queryModel(expr); + } + + /** + * Check if the internal {@link ISashWindowsContentProvider} is conformed to the specified expression. + * @param expr + * @throws QueryException + */ + public void assertConform(IModelExp expr) throws PagesModelException { + + Object first; + if( expr instanceof WindowTerm) { + first = getFirstWindowModel(); + } + else if( expr instanceof PanelTerm) { + first = getFirstPanelModel(); + } + else { + throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + expr.toString() + ")"); + } + + CheckVisitor visitor = new CheckVisitor(); + expr.accept(visitor, first); + } + + /** + * Create an internal model conform to the specified expression. + * Any previous model is disguarded. + * + * This method should only be called once on a {@link SimpleSashWindowsContentProvider}. + *
+ * If an expr term have a name, this name is kept in the facade and can be used later in methods like move, delete, ... + * + * @param expr Expression denoting the configuration to create. Must be one of (Folder, HSash, VSash) + * @throws QueryException + * + * TODO Ensure that the method can only be called once. For example, + * let this class extends {@link SimpleSashWindowsContentProvider}, and the constructor + * call this method. + */ + public void createModel(IModelExp expr) throws PagesModelException { + + Object first ; + if( expr instanceof PanelTerm) { + first = getFirstWindowModel(); + } + else { + throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + expr.toString() + ")"); + } + + // Create a surrounding WindowTerm + WindowTerm windowTerm = new WindowTerm((PanelTerm)expr); + + CreateModelInSimpleContentProviderVisitor visitor = new CreateModelInSimpleContentProviderVisitor(contentProvider); + windowTerm.accept(visitor, first); + + // Fill mapping + namesMapping = queryModel(expr); + } + + /** + * Get element in the model. + * Each model element whose corresponding model query part as a name is added to the result map. + * The element is then accessible with the name set in the query part. + * + * @param query + * @return + * @throws QueryException + */ + public Map queryModel(IModelExp query) throws PagesModelException { + + Object first; + if( query instanceof WindowTerm) { + first = getFirstWindowModel(); + } + else if( query instanceof PanelTerm) { + first = getFirstPanelModel(); + } + else { + throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); + } + + QueryVisitor visitor = new QueryVisitor(); + query.accept(visitor, first); + + return visitor.getResult(); + } + + /** + * Get the model of the first the first window (in actual implementation their is only one window). + * @return + */ + private RootModel getFirstWindowModel() { + // Silly method to get the RootModel + return (RootModel)((AbstractPanelModel)contentProvider.getRootModel()).getParent(); + } + + /** + * Get the panel of the first window (in actual implementation their is only one window). + * @return + */ + private AbstractPanelModel getFirstPanelModel() { + // In this implementation, the root is always of type AbstractPanelModel + return (AbstractPanelModel)contentProvider.getRootModel(); + } + + /** + * Add a page to the model + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.common.ISashWindowsContentProviderFacade#addPage(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page, java.lang.String, int) + * + * @param page + * @param folderName + * @param index + * @throws PagesModelException + */ + public void /*IPageModel*/ addPage(Page page, String folderName, int index) throws PagesModelException { + // Get the folder + TabFolderModel folderModel = getITabFolderModel( folderName ); + + IPageModel pageModel = createPageModel(page); + + contentProvider.addPage(folderModel, index, pageModel); + +// return pageModel; + } + + /** + * Add a page to the model + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.common.ISashWindowsContentProviderFacade#addPage(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page, java.lang.String, int) + * + * @param page + * @param folderName + * @throws PagesModelException + */ + public void /*IPageModel*/ addPage(Page page, String folderName) throws PagesModelException { + // Get the folder + TabFolderModel folderModel = getITabFolderModel( folderName ); + + IPageModel pageModel = createPageModel(page); + + contentProvider.addPage(folderModel, pageModel); + +// return pageModel; + } + + /** + * Create a {@link IPageModel} for the specified {@link Page}. + * @param page + * @return + */ + static public IPageModel createPageModel( Page page ) { + return new MessagePartModel( page.getName(), page.getName() ); + } + + /** + * + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.common.ISashWindowsContentProviderFacade#movePage(java.lang.String, int, int) + * + * @param folderName + * @param oldIndex + * @param newIndex + * @throws NotFoundException + */ + public void movePage(String folderName, int oldIndex, int newIndex) throws NotFoundException { + // Get the folder + ITabFolderModel folderModel = getITabFolderModel( folderName ); + + contentProvider.movePage(folderModel, oldIndex, newIndex); + } + + public void movePage(String srcFolderName, int sourceIndex, String targetFolderName, int targetIndex) throws NotFoundException { + // Get the folders + ITabFolderModel srcFolderModel = getITabFolderModel( srcFolderName ); + ITabFolderModel targetFolderModel = getITabFolderModel( targetFolderName ); + + contentProvider.movePage(srcFolderModel, sourceIndex, targetFolderModel, targetIndex); + } + + public void removePage(String pageName) throws NotFoundException { + IPageModel pageModel = getIPageModel(pageName); + + contentProvider.removePage(pageModel); + + } + + public void removePage(String folderName, int tabIndex) throws NotFoundException { + // Get the folder + ITabFolderModel folderModel = getITabFolderModel( folderName ); + + contentProvider.removePage(folderModel, tabIndex); + // TODO remove page name from context + } + + public void createFolder(String tabFolderName, int tabIndex, String targetFolderName, int side) throws PagesModelException { + // Get the folders + ITabFolderModel srcFolderModel = getITabFolderModel( tabFolderName ); + TabFolderModel targetFolderModel = getITabFolderModel( targetFolderName ); + + contentProvider.createFolder(srcFolderModel, tabIndex, targetFolderModel, side); + + } + + /** + * Add an element in namesMapping. Throw an exception if the name already exist or if the name is not correct. + * + * @param name + * @param element + * @throws BadNameException + */ + protected void putNameMapping( String name, Object element) throws BadNameException { + + if( name == null || name.length() == 0 ) { + throw new BadNameException("Name '" + name + "' is not valid."); + } + + if(namesMapping.containsKey(name)) { + throw new BadNameException("Name '" + name + "' already exist in the context. Can't add it (but element is created)."); + } + + } + /** + * Get the {@link ITabFolderModel} associated to the name. + * In this implementation, this is the internal folder. + * @param folderName + * @return + * @throws NotFoundException + */ + public TabFolderModel getITabFolderModel(String folderName) throws NotFoundException { + + + Object res = namesMapping.get(folderName); + if(res == null) + throw new NotFoundException("Folder named '" + folderName + "' not found in the context of the expression."); + + if( ! (res instanceof TabFolderModel) ) + throw new NotFoundException("An element named '" + folderName + "' is found but it is not of the expected type (ITabFolderModel). " ); + + return (TabFolderModel)res; + } + + /** + * Get the {@link IPageModel} associated to the name. + * In this implementation, this is the internal element. + * @param pageName + * @return + * @throws NotFoundException + */ + public IPageModel getIPageModel(String pageName) throws NotFoundException { + + + Object res = namesMapping.get(pageName); + if(res == null) + throw new NotFoundException("Page named '" + pageName + "' not found in the context of the expression."); + + if( ! (res instanceof IPageModel) ) + throw new NotFoundException("An element named '" + pageName + "' is found but it is not of the expected type (IPageModel). " ); + + return (IPageModel)res; + } + + /** + * Return the associated maps of (names, internal representation). + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade#getNamesToInternalMap() + * + * @return + */ + public Map getNamesToInternalMap() { + return namesMapping; + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeCommonTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeCommonTest.java new file mode 100644 index 00000000000..9a7db834273 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeCommonTest.java @@ -0,0 +1,44 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.AbstractSashWindowContentProviderFacadeTest; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade; + + +/** + * @author dumoulin + * + */ +public class SimpleSashWindowContainerTestFacadeCommonTest extends AbstractSashWindowContentProviderFacadeTest { + + /** + * Constructor. + * + */ + public SimpleSashWindowContainerTestFacadeCommonTest() { + super(); + } + + /** + * Return the concrete implementation under test. + * @return + */ + @Override + public ISashWindowsContentProviderFacade createISashWindowsContentProviderFacade() { + return new SimpleSashWindowContainerTestFacade(); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeTest.java new file mode 100644 index 00000000000..6c730d71e54 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContainerTestFacadeTest.java @@ -0,0 +1,91 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; + +import static org.junit.Assert.*; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + + +/** + * @author dumoulin + * + */ +public class SimpleSashWindowContainerTestFacadeTest { + + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + } + + /** + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContainerTestFacade#SimpleSashWindowContainerTestFacade()}. + */ + @Test + public void testSimpleSashWindowContainerTestFacade() { + SimpleSashWindowContainerTestFacade facade = new SimpleSashWindowContainerTestFacade(); + + assertNotNull("Facade created", facade); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContainerTestFacade#getSashContainer()}. + */ + @Test + public void testGetSashContainer() { + SimpleSashWindowContainerTestFacade facade = new SimpleSashWindowContainerTestFacade(); + + assertNotNull("Facade created", facade); + assertNotNull("container created", facade.getISashWindowsContainer() ); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContainerTestFacade#getIContentProvider()}. + */ + @Test + public void testGetIContentProvider() { + SimpleSashWindowContainerTestFacade facade = new SimpleSashWindowContainerTestFacade(); + + assertNotNull("Facade created", facade); + assertNotNull("contentProvider created", facade.getIContentProvider() ); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContainerTestFacade#dispose()}. + */ + @Test + public void testDispose() { + SimpleSashWindowContainerTestFacade facade = new SimpleSashWindowContainerTestFacade(); + + assertNotNull("Facade created", facade); + + facade.dispose(); + assertNull("contentProvider deleted", facade.getIContentProvider() ); + assertNull("container deleted", facade.getISashWindowsContainer() ); + + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacade.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacade.java new file mode 100644 index 00000000000..71442b938a0 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacade.java @@ -0,0 +1,368 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; + +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IAbstractPanelModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; +import org.eclipse.papyrus.infra.core.sasheditor.editor.MessagePartModel; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.BadNameException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.NotFoundException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PanelTerm; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade; + +/** + * Class providing a facade to test the {@link SimpleSashWindowsContentProvider} class. + *
+ * This facade own a {@link SimpleSashWindowsContentProvider} and provide methods to manipulate it with + * the help of names. Each element in the {@link SimpleSashWindowsContentProvider} can be identified + * by a name (String). Then, the facade provide methods similar to {@link ISashWindowsContentProvider}, but using + * names rather than {@link IAbstractPanelModel} and {@link ITabFolderModel}. + *
+ * The facade maintains a mapping between the names and the {@link ISashWindowsContentProvider} models. + * + * @author cedric dumoulin + * + */ +public class SimpleSashWindowContentProviderFacade implements ISashWindowsContentProviderFacade { + + /** + * The internal content provider this facade is for. + */ + protected SimpleSashWindowsContentProvider contentProvider; + + /** + * Mapping between names provided in the expressions and internal implementations of the {@link SimpleSashWindowsContentProvider}. + * This mapping is maintained when elements are added or removed. + * + */ + protected Map namesMapping; + + /** + * Constructor. + * Create a default internal {@link SimpleSashWindowsContentProvider}; + * @param modelMngr + */ + public SimpleSashWindowContentProviderFacade() { + this.contentProvider = new SimpleSashWindowsContentProvider(); + } + + /** + * Constructor. + * + * @param modelMngr + */ + public SimpleSashWindowContentProviderFacade(SimpleSashWindowsContentProvider contentProvider) { + this.contentProvider = contentProvider; + } + + /** + * @return the contentProvider + */ + public ISashWindowsContentProvider getIContentProvider() { + return contentProvider; + } + + + /** + * Reset the namesMapping context accordingly to the provided expr. + * A side effect is that the internal structure is checked against the expr. + *
+ * Reseting the names context allows to remove or add names to the context. + * It is used to add names of newly created elements (created with addPage() or createFolder() ) + + * @param expr + * @throws PagesModelException + */ + public void resetNamesContext(IModelExp expr) throws PagesModelException { + namesMapping = queryModel(expr); + } + + /** + * Check if the internal {@link ISashWindowsContentProvider} is conformed to the specified expression. + * @param expr + * @throws QueryException + */ + public void assertConform(IModelExp expr) throws PagesModelException { + + Object first; + if( expr instanceof WindowTerm) { + first = getFirstWindowModel(); + } + else if( expr instanceof PanelTerm) { + first = getFirstPanelModel(); + } + else { + throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + expr.toString() + ")"); + } + + CheckVisitor visitor = new CheckVisitor(); + expr.accept(visitor, first); + } + + /** + * Create an internal model conform to the specified expression. + * Any previous model is disguarded. + * + * This method should only be called once on a {@link SimpleSashWindowsContentProvider}. + *
+ * If an expr term have a name, this name is kept in the facade and can be used later in methods like move, delete, ... + * + * @param expr Expression denoting the configuration to create. Must be one of (Folder, HSash, VSash) + * @throws QueryException + * + * TODO Ensure that the method can only be called once. For example, + * let this class extends {@link SimpleSashWindowsContentProvider}, and the constructor + * call this method. + */ + public void createModel(IModelExp expr) throws PagesModelException { + + Object first ; + if( expr instanceof PanelTerm) { + first = getFirstWindowModel(); + } + else { + throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + expr.toString() + ")"); + } + + // Create a surrounding WindowTerm + WindowTerm windowTerm = new WindowTerm((PanelTerm)expr); + + CreateModelInSimpleContentProviderVisitor visitor = new CreateModelInSimpleContentProviderVisitor(contentProvider); + windowTerm.accept(visitor, first); + + // Fill mapping + namesMapping = queryModel(expr); + } + + /** + * Get element in the model. + * Each model element whose corresponding model query part as a name is added to the result map. + * The element is then accessible with the name set in the query part. + * + * @param query + * @return + * @throws QueryException + */ + public Map queryModel(IModelExp query) throws PagesModelException { + + Object first; + if( query instanceof WindowTerm) { + first = getFirstWindowModel(); + } + else if( query instanceof PanelTerm) { + first = getFirstPanelModel(); + } + else { + throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); + } + + QueryVisitor visitor = new QueryVisitor(); + query.accept(visitor, first); + + return visitor.getResult(); + } + + /** + * Get the model of the first the first window (in actual implementation their is only one window). + * @return + */ + private RootModel getFirstWindowModel() { + // Silly method to get the RootModel + return (RootModel)((AbstractPanelModel)contentProvider.getRootModel()).getParent(); + } + + /** + * Get the panel of the first window (in actual implementation their is only one window). + * @return + */ + private AbstractPanelModel getFirstPanelModel() { + // In this implementation, the root is always of type AbstractPanelModel + return (AbstractPanelModel)contentProvider.getRootModel(); + } + + /** + * Add a page to the model + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.common.ISashWindowsContentProviderFacade#addPage(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page, java.lang.String, int) + * + * @param page + * @param folderName + * @param index + * @throws PagesModelException + */ + public void /*IPageModel*/ addPage(Page page, String folderName, int index) throws PagesModelException { + // Get the folder + TabFolderModel folderModel = getITabFolderModel( folderName ); + + IPageModel pageModel = createPageModel(page); + + contentProvider.addPage(folderModel, index, pageModel); + +// return pageModel; + } + + /** + * Add a page to the model + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.common.ISashWindowsContentProviderFacade#addPage(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.Page, java.lang.String, int) + * + * @param page + * @param folderName + * @throws PagesModelException + */ + public void /*IPageModel*/ addPage(Page page, String folderName) throws PagesModelException { + // Get the folder + TabFolderModel folderModel = getITabFolderModel( folderName ); + + IPageModel pageModel = createPageModel(page); + + contentProvider.addPage(folderModel, pageModel); + +// return pageModel; + } + + /** + * Create a {@link IPageModel} for the specified {@link Page}. + * @param page + * @return + */ + static public IPageModel createPageModel( Page page ) { + return new MessagePartModel( page.getName(), page.getName() ); + } + + /** + * + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.common.ISashWindowsContentProviderFacade#movePage(java.lang.String, int, int) + * + * @param folderName + * @param oldIndex + * @param newIndex + * @throws NotFoundException + */ + public void movePage(String folderName, int oldIndex, int newIndex) throws NotFoundException { + // Get the folder + ITabFolderModel folderModel = getITabFolderModel( folderName ); + + contentProvider.movePage(folderModel, oldIndex, newIndex); + } + + public void movePage(String srcFolderName, int sourceIndex, String targetFolderName, int targetIndex) throws NotFoundException { + // Get the folders + ITabFolderModel srcFolderModel = getITabFolderModel( srcFolderName ); + ITabFolderModel targetFolderModel = getITabFolderModel( targetFolderName ); + + contentProvider.movePage(srcFolderModel, sourceIndex, targetFolderModel, targetIndex); + } + + public void removePage(String pageName) throws NotFoundException { + IPageModel pageModel = getIPageModel(pageName); + + contentProvider.removePage(pageModel); + + } + + public void removePage(String folderName, int tabIndex) throws NotFoundException { + // Get the folder + ITabFolderModel folderModel = getITabFolderModel( folderName ); + + contentProvider.removePage(folderModel, tabIndex); + // TODO remove page name from context + } + + public void createFolder(String tabFolderName, int tabIndex, String targetFolderName, int side) throws PagesModelException { + // Get the folders + ITabFolderModel srcFolderModel = getITabFolderModel( tabFolderName ); + TabFolderModel targetFolderModel = getITabFolderModel( targetFolderName ); + + contentProvider.createFolder(srcFolderModel, tabIndex, targetFolderModel, side); + + } + + /** + * Add an element in namesMapping. Throw an exception if the name already exist or if the name is not correct. + * + * @param name + * @param element + * @throws BadNameException + */ + protected void putNameMapping( String name, Object element) throws BadNameException { + + if( name == null || name.length() == 0 ) { + throw new BadNameException("Name '" + name + "' is not valid."); + } + + if(namesMapping.containsKey(name)) { + throw new BadNameException("Name '" + name + "' already exist in the context. Can't add it (but element is created)."); + } + + } + /** + * Get the {@link ITabFolderModel} associated to the name. + * In this implementation, this is the internal folder. + * @param folderName + * @return + * @throws NotFoundException + */ + public TabFolderModel getITabFolderModel(String folderName) throws NotFoundException { + + + Object res = namesMapping.get(folderName); + if(res == null) + throw new NotFoundException("Folder named '" + folderName + "' not found in the context of the expression."); + + if( ! (res instanceof TabFolderModel) ) + throw new NotFoundException("An element named '" + folderName + "' is found but it is not of the expected type (ITabFolderModel). " ); + + return (TabFolderModel)res; + } + + /** + * Get the {@link IPageModel} associated to the name. + * In this implementation, this is the internal element. + * @param pageName + * @return + * @throws NotFoundException + */ + public IPageModel getIPageModel(String pageName) throws NotFoundException { + + + Object res = namesMapping.get(pageName); + if(res == null) + throw new NotFoundException("Page named '" + pageName + "' not found in the context of the expression."); + + if( ! (res instanceof IPageModel) ) + throw new NotFoundException("An element named '" + pageName + "' is found but it is not of the expected type (IPageModel). " ); + + return (IPageModel)res; + } + + /** + * Return the associated maps of (names, internal representation). + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade#getNamesToInternalMap() + * + * @return + */ + public Map getNamesToInternalMap() { + return namesMapping; + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest.java new file mode 100644 index 00000000000..f69e3c1d34f --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest.java @@ -0,0 +1,151 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; + +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.folder; +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.page; +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.vSash; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; +import org.eclipse.swt.SWT; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + + +/** + * @author dumoulin + * + */ +public class SimpleSashWindowContentProviderFacadeTest { + + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + } + + /** + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#assertConform(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. + * @throws PagesModelException + */ + @Test + public void testAssertConform() throws PagesModelException { + SimpleSashWindowContentProviderFacade helper = new SimpleSashWindowContentProviderFacade(); + + assertNotNull("helper created", helper); + // Create a query + IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); + // Try to create the model + helper.createModel(expr); + + // Try to check model + helper.assertConform(expr); + + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#createModel(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. + * @throws PagesModelException + */ + @Test + public void testCreateModel() throws PagesModelException { + SimpleSashWindowContentProviderFacade helper = new SimpleSashWindowContentProviderFacade(); + + assertNotNull("helper created", helper); + // Create a query + IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); + // Try to create the model + helper.createModel(expr); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#queryModel(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. + * @throws PagesModelException + */ + @Test + public void testQueryModel() throws PagesModelException { + SimpleSashWindowContentProviderFacade helper = new SimpleSashWindowContentProviderFacade(); + + assertNotNull("helper created", helper); + // Create a query + IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); + // Try to create the model + helper.createModel(expr); + + // Query model + Map res = helper.queryModel(expr); + assertNotNull("found f1", res.get("f1")); + assertTrue("right type", res.get("f1") instanceof TabFolderModel ); + + assertNotNull("found f2", res.get("f2")); + assertTrue("right type", res.get("f2") instanceof TabFolderModel ); + + assertNotNull("found p2", res.get("p2")); + assertTrue("right type", res.get("p2") instanceof IPageModel ); + } + + /** + * Test folder creation. + * Use the pagemodels utilities {@link SimpleSashWindowContentProviderUtils}. + * @throws PagesModelException + */ + @Test + public void testCreateFolder() throws PagesModelException { + + + SimpleSashWindowContentProviderFacade helper = new SimpleSashWindowContentProviderFacade(); + + assertNotNull("helper created", helper); + // Create a query +// IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); + IModelExp expr = folder( "f1", page("p1"), page("p2"), page("p3"), page("p4"), + page("p5"), page("p6"), page("p7"), page("p8")); + // Try to create the model + helper.createModel(expr); + + // Create another folder + helper.createFolder("f1", 0, "f1", SWT.UP); + // Check the content configuration + IModelExp conf1Expr = vSash( + folder( "f2", page("p1") ), + folder( "f1", page("p2"), page("p3"), page("p4"), + page("p5"), page("p6"), page("p7"), page("p8") ) + ); + // Check if conform + helper.assertConform(conf1Expr); + + // Check resetContext + helper.resetNamesContext(conf1Expr); + + assertNotNull("new name found", helper.getITabFolderModel("f2")); + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest2.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest2.java new file mode 100644 index 00000000000..2e1e64ea1a3 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderFacadeTest2.java @@ -0,0 +1,44 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.AbstractSashWindowContentProviderFacadeTest; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProviderFacade; + + +/** + * @author dumoulin + * + */ +public class SimpleSashWindowContentProviderFacadeTest2 extends AbstractSashWindowContentProviderFacadeTest { + + /** + * Constructor. + * + */ + public SimpleSashWindowContentProviderFacadeTest2() { + super(); + } + + /** + * Return the concrete implementation under test. + * @return + */ + @Override + public ISashWindowsContentProviderFacade createISashWindowsContentProviderFacade() { + return new SimpleSashWindowContentProviderFacade(); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtils.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtils.java new file mode 100644 index 00000000000..ad9c9982db0 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtils.java @@ -0,0 +1,168 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; + +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PanelTerm; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.WindowTerm; +import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.ISashWindowsContentProviderTestUtils; + +/** + * Class providing some utilities to check the {@link SimpleSashWindowsContentProvider} class. + *
+ * This utilities allow to: populate a contentProvider, compare the contentProvider structure + * query the contentProvider structure. + * + * @author cedric dumoulin + * + */ +public class SimpleSashWindowContentProviderUtils implements ISashWindowsContentProviderTestUtils { + + /** + * ContentProvider used . + */ + protected SimpleSashWindowsContentProvider contentProvider; + + /** + * Constructor. + * Create a default internal {@link SimpleSashWindowsContentProvider}; + * @param modelMngr + */ + public SimpleSashWindowContentProviderUtils() { + this.contentProvider = new SimpleSashWindowsContentProvider(); + } + + /** + * Constructor. + * + * @param modelMngr + */ + public SimpleSashWindowContentProviderUtils(SimpleSashWindowsContentProvider contentProvider) { + this.contentProvider = contentProvider; + } + + + + /** + * @return the contentProvider + */ + public ISashWindowsContentProvider getIContentProvider() { + return contentProvider; + } + + + /** + * Check if the sashModel is conformed to the specified query. + * @param query + * @throws QueryException + */ + public void assertConform(IModelExp query) throws PagesModelException { + + Object first; + if( query instanceof WindowTerm) { + first = getFirstWindowModel(); + } + else if( query instanceof PanelTerm) { + first = getFirstPanelModel(); + } + else { + throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); + } + + CheckVisitor visitor = new CheckVisitor(); + query.accept(visitor, first); + } + + /** + * Create an internal model conform to the specified query. + * Any previous model is disguarded. + * + * This method should only be called once on a {@link SimpleSashWindowsContentProvider}. + * + * @param query Should be a subtype PanelTerm (Folder, HSash, VSash) + * @throws QueryException + * + * TODO Ensure that the method can only be called once. For example, + * let this class extends {@link SimpleSashWindowsContentProvider}, and the constructor + * call this method. + */ + public void createModel(IModelExp query) throws PagesModelException { + + Object first ; + if( query instanceof PanelTerm) { + first = getFirstWindowModel(); + } + else { + throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); + } + + // Create a surrounding WindowTerm + WindowTerm windowTerm = new WindowTerm((PanelTerm)query); + + CreateModelInSimpleContentProviderVisitor visitor = new CreateModelInSimpleContentProviderVisitor(contentProvider); + windowTerm.accept(visitor, first); + } + + /** + * Get element in the model. + * Each model element whose corresponding model query part as a name is added to the result map. + * The element is then accessible with the name set in the query part. + * + * @param query + * @return + * @throws QueryException + */ + public Map queryModel(IModelExp query) throws PagesModelException { + + Object first; + if( query instanceof WindowTerm) { + first = getFirstWindowModel(); + } + else if( query instanceof PanelTerm) { + first = getFirstPanelModel(); + } + else { + throw new PagesModelException("Don't know how to get the model associated to the first term of the expression (" + query.toString() + ")"); + } + + QueryVisitor visitor = new QueryVisitor(); + query.accept(visitor, first); + + return visitor.getResult(); + } + + /** + * Get the model of the first the first window (in actual implementation their is only one window). + * @return + */ + private RootModel getFirstWindowModel() { + // Silly method to get the RootModel + return (RootModel)((AbstractPanelModel)contentProvider.getRootModel()).getParent(); + } + + /** + * Get the panel of the first window (in actual implementation their is only one window). + * @return + */ + private AbstractPanelModel getFirstPanelModel() { + // In this implementation, the root is always of type AbstractPanelModel + return (AbstractPanelModel)contentProvider.getRootModel(); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtilsTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtilsTest.java new file mode 100644 index 00000000000..d284b7c819c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowContentProviderUtilsTest.java @@ -0,0 +1,115 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; + +import static org.junit.Assert.*; + +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; + +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.*; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + + +/** + * @author dumoulin + * + */ +public class SimpleSashWindowContentProviderUtilsTest { + + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + } + + /** + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#assertConform(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. + * @throws PagesModelException + */ + @Test + public void testAssertConform() throws PagesModelException { + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); + + assertNotNull("helper created", helper); + // Create a query + IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); + // Try to create the model + helper.createModel(expr); + + // Try to check model + helper.assertConform(expr); + + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#createModel(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. + * @throws PagesModelException + */ + @Test + public void testCreateModel() throws PagesModelException { + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); + + assertNotNull("helper created", helper); + // Create a query + IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); + // Try to create the model + helper.createModel(expr); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils#queryModel(org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp)}. + * @throws PagesModelException + */ + @Test + public void testQueryModel() throws PagesModelException { + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); + + assertNotNull("helper created", helper); + // Create a query + IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); + // Try to create the model + helper.createModel(expr); + + // Query model + Map res = helper.queryModel(expr); + assertNotNull("found f1", res.get("f1")); + assertTrue("right type", res.get("f1") instanceof TabFolderModel ); + + assertNotNull("found f2", res.get("f2")); + assertTrue("right type", res.get("f2") instanceof TabFolderModel ); + + assertNotNull("found p2", res.get("p2")); + assertTrue("right type", res.get("p2") instanceof IPageModel ); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowsContentProviderTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowsContentProviderTest.java new file mode 100644 index 00000000000..e4568089266 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowsContentProviderTest.java @@ -0,0 +1,326 @@ +/***************************************************************************** + * Copyright (c) 2009 CEA LIST & LIFL + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple; + +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.folder; +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.hSash; +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.page; +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.vSash; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; +import org.eclipse.swt.SWT; +import org.junit.Before; +import org.junit.Test; + + +/** + * @author cedric dumoulin + */ +public class SimpleSashWindowsContentProviderTest /* extends AbstractPapyrusTest */{ + + protected SimpleSashWindowsContentProvider contentProvider; + + /** + * Initialize the tree {@inheritDoc} + */ + @Before + public void setUp() throws Exception { + createContentProvider(); + } + + /** + * Create a tree + */ + private void createContentProvider() { + contentProvider = new SimpleSashWindowsContentProvider(); + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#addPage(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel)} + * . + */ + @Test + public void testAddTabIPageModel() { + IPageModel newModel = new FakePageModel(); + contentProvider.addPage(newModel); + + assertTrue("Folder contains added item", contentProvider.getCurrentTabFolder().getChildren().contains(newModel)); + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#movePage(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int, int)} + * . + */ + // public void testMoveTabITabFolderModelIntInt() { + // fail("Not yet implemented"); + // } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#movePage(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int, org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int)} + * . + */ + // public void testMoveTabITabFolderModelIntITabFolderModelInt() { + // fail("Not yet implemented"); + // } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#createFolder(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int, org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int)} + * . + */ + @Test + public void testCreateFolder() { + + // Create pages and add them to the default folder + List models = new ArrayList(); + for(int i = 0; i < 8; i++) { + IPageModel newModel = new FakePageModel("model" + i); + contentProvider.addPage(newModel); + models.add(newModel); + } + + ITabFolderModel folder = contentProvider.getCurrentTabFolder(); + + // // Do move tab 0 to right + // ITabFolderModel newFolder = contentProvider.createFolder(folder, 0, folder, SWT.RIGHT); + // // Check creation + // assertNotNull("Folder created", newFolder); + // // Check if correctly attached and reachable + // assertEquals("Tab 2 added in correct folder", folder, contentProvider.getParentFolder(newModel2)); + // assertEquals("Tab 1 added in correct folder", newFolder, contentProvider.getParentFolder(newModel1)); + // + //// assertNotNull("folder attached", contentProvider.getParentFolder(newModel1)); + //// assertNotNull("folder attached", contentProvider.getParentFolder(newModel1)); + // + // assertTrue("Folder contains added item", newFolder.getChildren().contains(newModel1)); + // assertTrue("Folder contains added item", folder.getChildren().contains(newModel2)); + + + // + // Create another folder + int index = 0; + IPageModel movedTab = models.get(index++); + assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); + contentProvider.createFolder(folder, 0, folder, SWT.UP); + // Find created folder + ITabFolderModel newFolder2 = contentProvider.getParentFolder(movedTab); + assertFolderCreated(folder, newFolder2, movedTab); + + movedTab = models.get(index++); + assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); + contentProvider.createFolder(folder, 0, newFolder2, SWT.UP); + ITabFolderModel newFolder3 = contentProvider.getParentFolder(movedTab); + assertFolderCreated(folder, newFolder3, movedTab); + + movedTab = models.get(index++); + assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); + contentProvider.createFolder(folder, 0, newFolder2, SWT.DOWN); + ITabFolderModel newFolder4 = contentProvider.getParentFolder(movedTab); + assertFolderCreated(folder, newFolder4, movedTab); + + movedTab = models.get(index++); + assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); + contentProvider.createFolder(folder, 0, folder, SWT.LEFT); + ITabFolderModel newFolder5 = contentProvider.getParentFolder(movedTab); + assertFolderCreated(folder, newFolder5, movedTab); + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#createFolder(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int, org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int)} + * . + */ + @Test + public void testCreateFolder_ITabFolderModel_int() { + + // Create pages and add them to the default folder + List models = new ArrayList(); + for(int i = 0; i < 8; i++) { + IPageModel newModel = new FakePageModel("model" + i); + contentProvider.addPage(newModel); + models.add(newModel); + } + + ITabFolderModel referenceFolder = contentProvider.getCurrentTabFolder(); + + assertNotNull("referenceFolder exist", referenceFolder); + + // Create a new folder. + ITabFolderModel createdFolder = contentProvider.createFolder(referenceFolder, SWT.TOP); + + assertNotNull("folder created", createdFolder); + + } + + /** + * Assert folder is correctly created + * + * @param srcFolder + * @param newFolder + * @param movedTab + */ + protected void assertFolderCreated(ITabFolderModel srcFolder, ITabFolderModel newFolder, IPageModel movedTab) { + // Check creation + assertNotNull("Folder exist", newFolder); + + // Check if it is really a new folder + assertNotSame("Old folder and new folder are differents", srcFolder, newFolder); + + // Check removed from source + assertFalse("item removed from source folder", srcFolder.getChildren().contains(movedTab)); + // Check contained in created folder + assertTrue("Folder contains added item", newFolder.getChildren().contains(movedTab)); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#removePage(int)}. + */ + // public void testRemoveTabInt() { + // fail("Not yet implemented"); + // } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#movePage(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int, int)} + * . + */ + // public void testMoveTabITabFolderModelIntInt() { + // fail("Not yet implemented"); + // } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#movePage(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int, org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel, int)} + * . + */ + // public void testMoveTabITabFolderModelIntITabFolderModelInt() { + // fail("Not yet implemented"); + // } + + /** + * Test folder creation. + * Use the pagemodels utilities {@link SimpleSashWindowContentProviderUtils}. + * + * @throws PagesModelException + */ + @Test + public void testCreateFolder2() throws PagesModelException { + + + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); + + assertNotNull("helper created", helper); + // Create a query + // IModelExp expr = vSash( folder( "f1", page("p1")), folder( "f2", page("p2"))); + IModelExp expr = folder("f1", page("p1"), page("p2"), page("p3"), page("p4"), page("p5"), page("p6"), page("p7"), page("p8")); + // Try to create the model + helper.createModel(expr); + + // Query model + Map res = helper.queryModel(expr); + // Get a folder + ITabFolderModel folder = (ITabFolderModel)res.get("f1"); + + // Create another folder + IPageModel movedTab = (IPageModel)res.get("p1"); + assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); + contentProvider.createFolder(folder, 0, folder, SWT.UP); + // Find created folder + ITabFolderModel newFolder2 = contentProvider.getParentFolder(movedTab); + assertFolderCreated(folder, newFolder2, movedTab); + + // Check the content configuration + IModelExp conf1Expr = vSash(folder("f2", page("p1")), folder("f1", page("p2"), page("p3"), page("p4"), page("p5"), page("p6"), page("p7"), page("p8"))); + // Check if conform + helper.assertConform(conf1Expr); + + Map conf1 = helper.queryModel(conf1Expr); + assertEquals("right page moved", res.get("p1"), conf1.get("p1")); + + + + movedTab = (IPageModel)res.get("p2"); + assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); + contentProvider.createFolder(folder, 0, newFolder2, SWT.UP); + ITabFolderModel newFolder3 = contentProvider.getParentFolder(movedTab); + assertFolderCreated(folder, newFolder3, movedTab); + + // Check the content configuration + IModelExp conf2Expr = vSash(vSash(folder("f3", page("p2")), folder("f2", page("p1"))), folder("f1", page("p3"), page("p4"), page("p5"), page("p6"), page("p7"), page("p8"))); + // Check if conform + helper.assertConform(conf2Expr); + + Map conf2 = helper.queryModel(conf2Expr); + assertEquals("right page moved", res.get("p2"), conf2.get("p2")); + + + // Next move + movedTab = (IPageModel)res.get("p3"); + assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); + contentProvider.createFolder(folder, 0, newFolder2, SWT.DOWN); + ITabFolderModel newFolder4 = contentProvider.getParentFolder(movedTab); + assertFolderCreated(folder, newFolder4, movedTab); + + // Check the content configuration + IModelExp conf3Expr = vSash(vSash(folder("f3", page("p2")), vSash(folder("f2", page("p1")), folder("f4", page("p3")))), folder("f1", page("p4"), page("p5"), page("p6"), page("p7"), page("p8"))); + // Check if conform + helper.assertConform(conf3Expr); + + Map conf3 = helper.queryModel(conf3Expr); + assertEquals("right page moved", res.get("p3"), conf3.get("p3")); + + // Move next folder + movedTab = (IPageModel)res.get("p4"); + assertEquals("moved tab is the first in tab", movedTab, folder.getChildren().get(0)); + contentProvider.createFolder(folder, 0, folder, SWT.LEFT); + ITabFolderModel newFolder5 = contentProvider.getParentFolder(movedTab); + assertFolderCreated(folder, newFolder5, movedTab); + + // Check the content configuration + IModelExp conf4Expr = vSash(vSash(folder("f3", page("p2")), vSash(folder("f2", page("p1")), folder("f4", page("p3")))), hSash(folder("f5", page("p4")), folder("f1", page("p5"), page("p6"), page("p7"), page("p8")))); + // Check if conform + helper.assertConform(conf4Expr); + + Map conf4 = helper.queryModel(conf4Expr); + assertEquals("right page moved", res.get("p4"), conf4.get("p4")); + + + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider#removePage(org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel)} + * . + */ + // public void testRemoveTabIPageModel() { + // fail("Not yet implemented"); + // } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/AllTests.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/AllTests.java new file mode 100644 index 00000000000..9b09af8ce8e --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/AllTests.java @@ -0,0 +1,26 @@ +/***************************************************************************** + * Copyright (c) 2010 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 + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.editor; + +import org.junit.runner.RunWith; +import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; +import org.junit.runners.Suite.SuiteClasses; + + +/** + * All tests for package org.eclipse.papyrus.infra.core.sasheditor.editor + */ +@RunWith(ClassificationSuite.class) +@SuiteClasses({ SashMultiPageEditorTest.class }) +public class AllTests { + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/FakeEditorModel.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/FakeEditorModel.java new file mode 100644 index 00000000000..892cb0522b2 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/FakeEditorModel.java @@ -0,0 +1,137 @@ +/***************************************************************************** + * Copyright (c) 2010, 2014 LIFL, 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: + * + * LIFL - Initial API and implementation + * Christian W. Damus (CEA) - bug 392301 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.editor; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.part.EditorActionBarContributor; +import org.eclipse.ui.part.EditorPart; + + +/** + * A simple model that can be used as editor in tests. + * @author cedric dumoulin + * + */ +public class FakeEditorModel implements IEditorModel { + + + private String name; + + public FakeEditorModel() { + name = "noname"; + } + + public void dispose() { + // Pass + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel#getTabTitle() + * + * @return + */ + public String getTabTitle() { + return name; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel#getTabIcon() + * + * @return + */ + public Image getTabIcon() { + return null; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel#getRawModel() + * + * @return + */ + public Object getRawModel() { + // TODO Auto-generated method stub + return this; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel#createIEditorPart() + * + * @return + * @throws PartInitException + */ + public IEditorPart createIEditorPart() throws PartInitException { + return new FakeEditorPart(); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel#getActionBarContributor() + * + * @return + */ + public EditorActionBarContributor getActionBarContributor() { + return null; + } + + /** + * A class implementing a fake editor. + * @author dumoulin + * + */ + public class FakeEditorPart extends EditorPart { + + @Override + public void doSave(IProgressMonitor monitor) { + } + + @Override + public void doSaveAs() { + } + + @Override + public void init(IEditorSite site, IEditorInput input) throws PartInitException { + setSite(site); + setInput(input); + setPartName(input.getName()); + } + + @Override + public boolean isDirty() { + return false; + } + + @Override + public boolean isSaveAsAllowed() { + return false; + } + + @Override + public void createPartControl(Composite parent) { + // do nothing + + } + + @Override + public void setFocus() { + } + + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/MessagePartModel.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/MessagePartModel.java new file mode 100644 index 00000000000..01d9aae5267 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/MessagePartModel.java @@ -0,0 +1,90 @@ +/***************************************************************************** + * Copyright (c) 2009, 2014 LIFL, 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: + * + * LIFL - Initial API and implementation + * Christian W. Damus (CEA) - bug 392301 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.editor; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IComponentModel; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; + +/** + * Description of the first page + * + * @author dumoulin + */ + +public class MessagePartModel implements IComponentModel { + + private String title; + + private String msg; + + static private int count = 0; + + + /** + * + */ + public MessagePartModel(String msg) { + title = "newMsg " + count++; + this.msg = msg; + } + + /** + * @param title + */ + public MessagePartModel(String title, String msg) { + this.title = title; + this.msg = msg; + } + + /** + * Return the control to be shown. {@inheritDoc} + */ + public Composite createPartControl(Composite parent) { + Composite composite = new Composite(parent, SWT.NONE); + FillLayout layout = new FillLayout(); + composite.setLayout(layout); + StyledText text; + + text = new StyledText(composite, SWT.H_SCROLL | SWT.V_SCROLL); + text.setEditable(false); + + text.setText(" " + msg + " - " + getTabTitle()); + return composite; + } + + public Image getTabIcon() { + return null; + } + + public String getTabTitle() { + return title; + } + + /** + * Return this. In this implementation, the rawModel and the IEditorModel are the same. + * + */ + public Object getRawModel() { + return this; + } + + public void dispose() { + // Pass + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/SashMultiPageEditorTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/SashMultiPageEditorTest.java new file mode 100644 index 00000000000..f890f5c2917 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/SashMultiPageEditorTest.java @@ -0,0 +1,25 @@ +/** + * + */ +package org.eclipse.papyrus.infra.core.sasheditor.editor; + +import org.junit.Ignore; +import org.junit.Test; + + + +/** + * @author dumoulin + */ +public class SashMultiPageEditorTest { + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.editor.AbstractMultiPageSashEditor#refreshTabs()}. + */ + @Ignore("Not yet implemented") + @Test + public void testRefreshTabs() { + // fail("Not yet implemented"); // TODO + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/ShellEditor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/ShellEditor.java new file mode 100644 index 00000000000..f341e974d21 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/editor/ShellEditor.java @@ -0,0 +1,113 @@ +/***************************************************************************** + * Copyright (c) 2009 CEA LIST & LIFL + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.editor; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; + + +/** + * A standalone application testing the Sash system. + * It must be run as Java program. + * + * @author dumoulin + */ +public class ShellEditor { + + protected SashWindowsContainer sashContainer; + + protected ISashWindowsContentProvider contentProvider; + + /** + * Constructor. + * + * @param parent + */ + public ShellEditor(Shell parent) { + parent.setText(this.getClass().getSimpleName()); + init(); + createPartControl(parent); + + // add tabItem + int count = 0; + IPageModel tabItem = new MessagePartModel("msg" + count++); + contentProvider.addPage(tabItem); + tabItem = new MessagePartModel("msg" + count++); + contentProvider.addPage(tabItem); + + sashContainer.refreshTabs(); + } + + /** + * init th class + */ + protected void init() { + contentProvider = new SimpleSashWindowsContentProvider(); + sashContainer = new SashWindowsContainer(); + + initContentProvider(); + sashContainer.setContentProvider(contentProvider); + + } + + /** + * Create some windows. + */ + protected void initContentProvider() { + int count = 0; + IPageModel tabItem = new MessagePartModel("msg" + count++); + contentProvider.addPage(tabItem); + + tabItem = new MessagePartModel("msg0" + count++); + contentProvider.addPage(tabItem); + } + + /** + * Create SWT control of this class + * + * @param parent + */ + protected void createPartControl(Composite parent) { + // Text newText = new Text(parent, SWT.BORDER & SWT.SCROLL_PAGE); + + sashContainer.createPartControl(parent); + } + + /** + * @param args + */ + public static void main(String[] args) { + Display display = new Display(); + + Shell shell = new Shell(display); + shell.setLayout(new FillLayout()); + new ShellEditor(shell); + + shell.open(); + + while(!shell.isDisposed()) { + if(!display.readAndDispatch()) + display.sleep(); + } + + display.dispose(); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/AllTests.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/AllTests.java new file mode 100644 index 00000000000..1bd8986172b --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/AllTests.java @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (c) 2010 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 + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.internal; + +import org.junit.runner.RunWith; +import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; +import org.junit.runners.Suite.SuiteClasses; + + +/** + * All tests for package org.eclipse.papyrus.infra.core.sasheditor.internal + */ +@RunWith(ClassificationSuite.class) +@SuiteClasses({ SashContainerEventsProviderTest.class, + PageLifeCycleEventsThrownFromContainerTest.class, + SashWindowsContainerTest.class , + SashWindowsContainerDisposeCalledTest.class, + SashWindowsContainerMemoryLeakTest.class + }) +public class AllTests { + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeFolderLifeCycleEventsListener.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeFolderLifeCycleEventsListener.java new file mode 100644 index 00000000000..699885a9148 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeFolderLifeCycleEventsListener.java @@ -0,0 +1,143 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.internal; + +import java.util.ArrayList; +import java.util.List; + + +/** + * A fake listener implementation for testing purpose. + * @author cedric dumoulin + * + */ +public class FakeFolderLifeCycleEventsListener implements ITabFolderPartLifeCycleEventsListener { + + public static final String FOLDER_CREATED = "folderCreated"; + + public static final String FOLDER_DISPOSED = "folderDisposed"; + + + /** */ + public int eventCount = 0; + + /** */ + public List traces; + + /** */ + public List events; + + /** + * + * Constructor. + * + */ + public FakeFolderLifeCycleEventsListener() { + traces = new ArrayList(); + events = new ArrayList(); + } + + + /** + * @return the eventCount + */ + public int getEventCount() { + return eventCount; + } + + + /** + * @return the trace + */ + public List getTraces() { + return traces; + } + + /** + * @return the trace + */ + public String getTrace(int index) { + return traces.get(index); + } + + /** + * @return the trace + */ + public List getEvents() { + return events; + } + + /** + * @return the trace + */ + public TabFolderPart getEvent(int index) { + return events.get(index); + } + + /** + * + */ + public void resetChangeCount() { + eventCount = 0; + } + + /** + * + */ + public void resetTraces() { + traces.clear(); + events.clear(); + } + + /* ************************** */ + /* Methods */ + /* ************************** */ + + + public void folderCreated(TabFolderPart folder) { + traces.add(FOLDER_CREATED); + events.add(folder); + eventCount++; + } + + + public void folderDisposed(TabFolderPart folder) { + traces.add(FOLDER_DISPOSED); + events.add(folder); + eventCount++; + } + + @Override + public String toString() { + + StringBuffer buf = new StringBuffer(); + buf.append("{"); + for( int i=0; i traces; + + /** */ + public List events; + + /** + * + * Constructor. + * + */ + public FakePageLifeCycleEventsListener() { + traces = new ArrayList(); + events = new ArrayList(); + } + + + /** + * @return the eventCount + */ + public int getEventCount() { + return eventCount; + } + + + /** + * @return the trace + */ + public List getTraces() { + return traces; + } + + /** + * @return the trace + */ + public String getTrace(int index) { + return traces.get(index); + } + + /** + * @return the trace + */ + public List getEvents() { + return events; + } + + /** + * @return the trace + */ + public IPage getEvent(int index) { + return events.get(index); + } + + /** + * + */ + public void resetChangeCount() { + eventCount = 0; + } + + /** + * + */ + public void resetTraces() { + traces.clear(); + events.clear(); + } + + /* ************************** */ + /* Methods */ + /* ************************** */ + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.editor.IPageChangedListener#pageChanged(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage) + * + * @param newPage + */ + public void pageChanged(IPage newPage) { + traces.add(PAGE_CHANGED); + events.add(newPage); + eventCount++; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.IPageLifeCycleEventsListener#pageOpened(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage) + * + * @param page + */ + public void pageOpened(IPage page) { + traces.add(PAGE_OPENED); + events.add(page); + eventCount++; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.IPageLifeCycleEventsListener#pageClosed(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage) + * + * @param page + */ + public void pageClosed(IPage page) { + traces.add(PAGE_CLOSED); + events.add(page); + eventCount++; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.IPageLifeCycleEventsListener#pageActivated(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage) + * + * @param page + */ + public void pageActivated(IPage page) { + traces.add(PAGE_ACTIVATED); + events.add(page); + eventCount++; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.IPageLifeCycleEventsListener#pageDeactivated(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage) + * + * @param page + */ + public void pageDeactivated(IPage page) { + traces.add(PAGE_DEACTIVATED); + events.add(page); + eventCount++; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.IPageLifeCycleEventsListener#pageAboutToBeOpened(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage) + * + * @param page + */ + public void pageAboutToBeOpened(IPage page) { + traces.add(PAGE_ABOUTTOBEOPENED); + events.add(page); + eventCount++; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.IPageLifeCycleEventsListener#pageAboutToBeClosed(org.eclipse.papyrus.infra.core.sasheditor.editor.IPage) + * + * @param page + */ + public void pageAboutToBeClosed(IPage page) { + traces.add(PAGE_ABOUTTOBECLOSED); + events.add(page); + eventCount++; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakePagePart.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakePagePart.java new file mode 100644 index 00000000000..5846412e14b --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakePagePart.java @@ -0,0 +1,69 @@ +/** + * + */ +package org.eclipse.papyrus.infra.core.sasheditor.internal; + +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; + + +/** + * A Page part for testing purpose. This page cannot be used in the SashContainer. + * @author cedric dumoulin + * + */ +public class FakePagePart extends PagePart { + + public FakePagePart() { + super(null, null); + } + + @Override + boolean visit(IPartVisitor visitor) { + // TODO Auto-generated method stub + return false; + } + + @Override + public void createPartControl(Composite parent) { + // TODO Auto-generated method stub + + } + + @Override + public Control getControl() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void reparent(TabFolderPart parent) { + // TODO Auto-generated method stub + + } + + @Override + public void setFocus() { + // TODO Auto-generated method stub + + } + + @Override + public void garbage() { + // TODO Auto-generated method stub + + } + + @Override + public void dispose() { + // TODO Auto-generated method stub + + } + + @Override + public void disposeThisAndChildren() { + // TODO Auto-generated method stub + + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeTabFolderPart.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeTabFolderPart.java new file mode 100644 index 00000000000..a625663023f --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FakeTabFolderPart.java @@ -0,0 +1,36 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.internal; + + +/** + * A fake {@link TabFolderPart} for testing purpose. + * Do not use in a SashContainer. + * This class allows to instanciate a {@link TabFolderPart}. + * + * @author cedric dumoulin + * + */ +public class FakeTabFolderPart extends TabFolderPart { + + /** + * Create a fake {@link TabFolderPart} + * Constructor. + * + */ + public FakeTabFolderPart() { + super( new RootPart(null), null, null); + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FolderLifeCycleEventsThrownFromContainerTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FolderLifeCycleEventsThrownFromContainerTest.java new file mode 100644 index 00000000000..d2afc1766ee --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/FolderLifeCycleEventsThrownFromContainerTest.java @@ -0,0 +1,163 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.internal; + +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.folder; +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.page; +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.vSash; +import static org.junit.Assert.assertEquals; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContainerTestFacade; +import org.eclipse.papyrus.infra.core.sasheditor.editor.IPage; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; +import org.eclipse.swt.SWT; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + + +/** + * Test if the {@link SashWindowsContainer} send the events of a folder lifecycle. + * Test if the folder lifecycle events are correctly thrown by the {@link SashWindowsContainer} when + * folder are added/removed, ... + * + * @author cedric dumoulin + * + */ +public class FolderLifeCycleEventsThrownFromContainerTest { + + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + } + + /** + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + } + + + /** + * Lookup a page by its raw model. + * @param container + * @param rawModel + * @return + */ + protected IPage lookupTabFolderPart(SashWindowsContainer container, Object rawModel) { + + LookupModelPageVisitor visitor = new LookupModelPageVisitor(rawModel); + container.visit(visitor); + return visitor.result(); + } + + + /** + * Test if the FOLDER_ADDED event is sent when a folder is added. + * @throws PagesModelException + */ + @Test + public void testFolderAddedEvent() throws PagesModelException { + + SimpleSashWindowContainerTestFacade containerFacade = new SimpleSashWindowContainerTestFacade(); + // get container and contentProvider + ISashWindowsContentProvider contentProvider = containerFacade.getIContentProvider(); + SashWindowsContainer container = containerFacade.getSashContainer(); + + // Create listener and attach it + FakeFolderLifeCycleEventsListener listener = new FakeFolderLifeCycleEventsListener(); + container.getFolderLifeCycleEventProvider().addListener(listener); + + // init the container + IModelExp expr = vSash( + folder( "f1", page("p2"), page("p3"), page("p4") ), + folder( "f2", page("p1") ) + ); + containerFacade.createModel(expr); + + // Do refresh. This fire events + container.refreshTabs(); + // Check events + assertEquals("event fired. listener=" + listener.toString(), 3, listener.getEventCount()); + int i=0; + assertEquals("right event", FakeFolderLifeCycleEventsListener.FOLDER_CREATED, listener.getTraces().get(i)); + assertEquals("right object", containerFacade.getNamesToInternalMap().get("f1"), listener.getEvents().get(i++).getRawModel()); + assertEquals("right event", FakeFolderLifeCycleEventsListener.FOLDER_CREATED, listener.getTraces().get(i)); + assertEquals("right object", containerFacade.getNamesToInternalMap().get("f2"), listener.getEvents().get(i++).getRawModel()); + // There is 3 events. The last one is the disposal of the folder that exist before the refresh, and replaced by + // two other folders. + assertEquals("right event", FakeFolderLifeCycleEventsListener.FOLDER_DISPOSED, listener.getTraces().get(i)); + + + // Reset the listener + listener.resetChangeCount(); + listener.resetTraces(); + + // Add a folder + containerFacade.createFolder("f1", 0, "f1", SWT.RIGHT); + container.refreshTabs(); + + // check events + assertEquals("event fired", 1, listener.getEventCount()); + i=0; + assertEquals("right event", FakeFolderLifeCycleEventsListener.FOLDER_CREATED, listener.getTraces().get(i++)); + } + + /** + * Test if the FOLDER_DISPOSED event is sent when a folder is added. + * @throws PagesModelException + */ + @Test + public void testFolderDisposedEvent() throws PagesModelException { + + SimpleSashWindowContainerTestFacade containerFacade = new SimpleSashWindowContainerTestFacade(); + // get container and contentProvider + ISashWindowsContentProvider contentProvider = containerFacade.getIContentProvider(); + SashWindowsContainer container = containerFacade.getSashContainer(); + + // Create listener and attach it + FakeFolderLifeCycleEventsListener listener = new FakeFolderLifeCycleEventsListener(); + container.getFolderLifeCycleEventProvider().addListener(listener); + + // init the container + IModelExp expr = vSash( + folder( "f1", page("p2"), page("p3"), page("p4") ), + folder( "f2", page("p1") ) + ); + containerFacade.createModel(expr); + + // Do refresh. This fire events + container.refreshTabs(); + + // Reset the listener + listener.resetChangeCount(); + listener.resetTraces(); + + // Remove page. This should remove the folder + containerFacade.removePage("p1"); + container.refreshTabs(); + + // check events + assertEquals("event fired " + listener.toString(), 1, listener.getEventCount()); + int i=0; + assertEquals("right event", FakeFolderLifeCycleEventsListener.FOLDER_DISPOSED, listener.getTraces().get(i)); + assertEquals("right object", containerFacade.getNamesToInternalMap().get("f2"), listener.getEvents().get(i++).getRawModel()); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/PageLifeCycleEventsThrownFromContainerTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/PageLifeCycleEventsThrownFromContainerTest.java new file mode 100644 index 00000000000..39ed1ba71e7 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/PageLifeCycleEventsThrownFromContainerTest.java @@ -0,0 +1,336 @@ +/** + * + */ +package org.eclipse.papyrus.infra.core.sasheditor.internal; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.editor.IPage; +import org.eclipse.papyrus.infra.core.sasheditor.editor.MessagePartModel; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Test if the {@link SashWindowsContainer} send the events of a page lifecycle. + * Test if the page lifecycle events are correctly thrown by the {@link SashWindowsContainer} when + * page are added/removed, ... + * + * @author cedric dumoulin + * + */ +public class PageLifeCycleEventsThrownFromContainerTest /* extends AbstractPapyrusTest */{ + + protected Display display; + + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + if(display == null || display.isDisposed()) { + display = Display.getCurrent(); + } + if(display == null) { + display = new Display(); + } + } + + /** + * + * @return + */ + private Display getDisplay() { + return display; + } + + /** + * Create a {@link SashWindowsContainer} to test. Initialize it with provided {@link ISashWindowsContentProvider}. + * + * @param contentProvider + * @return + */ + protected SashWindowsContainer createSashWindowsContainer(ISashWindowsContentProvider contentProvider) { + + display = getDisplay(); + Shell shell = new Shell(display); + shell.setLayout(new FillLayout()); + + // + //new ShellEditor(shell); + SashWindowsContainer sashWindowContainer = new SashWindowsContainer(); + + sashWindowContainer.setContentProvider(contentProvider); + + sashWindowContainer.createPartControl(shell); + // shell.open(); + return sashWindowContainer; + } + + /** + * Create a contentProvider. + * + * @return + */ + protected SimpleSashWindowsContentProvider createContentProvider() { + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + + // Create pages and add them to the default folder + List models = new ArrayList(); + for(int i = 0; i < 8; i++) { + IPageModel newModel = new MessagePartModel("model" + i); + contentProvider.addPage(newModel); + models.add(newModel); + } + + return contentProvider; + } + + /** + * Lookup a page by its raw model. + * + * @param container + * @param rawModel + * @return + */ + protected IPage lookupTabFolderPart(SashWindowsContainer container, Object rawModel) { + + LookupModelPageVisitor visitor = new LookupModelPageVisitor(rawModel); + container.visit(visitor); + return visitor.result(); + } + + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#addListener(org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsListener)} + * . + */ + @Ignore("TODO") + @Test + public void testAddActiveEditorChangedListener() { + //TODO + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#removeListener(org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsListener)} + * . + */ + @Ignore("TODO") + @Test + public void testRemoveActiveEditorChangedListener() { + //TODO + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageOpenedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} + * . + */ + @Test + public void testFirePageOpenedEvent() { + + // Create container and contentProvider + ISashWindowsContentProvider contentProvider = createContentProvider(); + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + + // Create listener and attach it + FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); + container.addPageLifeCycleListener(listener); + + // Do refresh. This fire events + container.refreshTabs(); + listener.resetChangeCount(); + listener.resetTraces(); + + + // Add an editor + contentProvider.addPage(new MessagePartModel("newPage")); + container.refreshTabs(); + + // check events (there is more than the 2 expected) + assertTrue("event fired", 2 <= listener.getEventCount()); + int i = 0; + assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ABOUTTOBEOPENED, listener.getTraces().get(i++)); + assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_OPENED, listener.getTraces().get(i++)); + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageClosedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} + * . + */ + @Test + public void testFirePageClosedEvent() { + // Create container and contentProvider + ISashWindowsContentProvider contentProvider = createContentProvider(); + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + + // Create listener and attach it + FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); + container.addPageLifeCycleListener(listener); + + // Do refresh. This fire events + container.refreshTabs(); + + + // Add an editor + IPageModel model = new MessagePartModel("newPage"); + contentProvider.addPage(model); + container.refreshTabs(); + listener.resetChangeCount(); + listener.resetTraces(); + + IPage page1 = lookupTabFolderPart(container, model); + assertNotNull("Page found", page1); + + // Close page + contentProvider.removePage(model); + container.refreshTabs(); + + // check events (there is more than the 2 expected) + assertTrue("event fired", 2 <= listener.getEventCount()); + + assertTrue("close event fired", listener.getEvents().contains(page1)); + assertTrue("close event fired", listener.getTraces().contains(FakePageLifeCycleEventsListener.PAGE_CLOSED)); + int index = listener.getTraces().indexOf(FakePageLifeCycleEventsListener.PAGE_CLOSED); + assertEquals("right page closed", page1, listener.getEvent(index)); + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageAboutToBeOpenedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} + * . + */ + @Test + public void testFirePageAboutToBeOpenedEvent() { + // Create container and contentProvider + ISashWindowsContentProvider contentProvider = createContentProvider(); + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + + // Create listener and attach it + FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); + container.addPageLifeCycleListener(listener); + + // Do refresh. This fire events + container.refreshTabs(); + listener.resetChangeCount(); + listener.resetTraces(); + + + // Add an editor + contentProvider.addPage(new MessagePartModel("newPage")); + container.refreshTabs(); + + // check events (there is more than the 2 expected) + assertTrue("event fired", 2 <= listener.getEventCount()); + int i = 0; + assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ABOUTTOBEOPENED, listener.getTraces().get(i++)); + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageAboutToBeClosedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} + * . + */ + @Test + public void testFirePageAboutToBeClosedEvent() { + // no such event anymore + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageActivatedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} + * . + */ + @Test + public void testFirePageActivatedEvent() { + // Create container and contentProvider + SimpleSashWindowsContentProvider contentProvider = createContentProvider(); + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + + // Create listener and attach it + FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); + container.addPageLifeCycleListener(listener); + + container.refreshTabs(); + + + // Add two pages + IPageModel pageModel1 = new MessagePartModel("newPage1"); + IPageModel pageModel2 = new MessagePartModel("newPage2"); + contentProvider.addPage(pageModel1); + contentProvider.addPage(pageModel2); + + + // Do refresh. This fire events + container.refreshTabs(); + listener.resetChangeCount(); + listener.resetTraces(); + + // Activate page 2 (1 is already active, and activate it + // do not throw events) + IPage page1 = lookupTabFolderPart(container, pageModel2); + container.selectPage(page1); + + // check events (1 expected) + assertEquals("event fired", 1, listener.getEventCount()); + int i = 0; + assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ACTIVATED, listener.getTraces().get(i++)); + + // **************** + // Check with a move + listener.resetChangeCount(); + listener.resetTraces(); + + ITabFolderModel folderModel = contentProvider.getCurrentTabFolder(); + contentProvider.createFolder(folderModel, 0, folderModel, SWT.TOP); + + // Do refresh. This fire events + container.refreshTabs(); + // check events (there is none, as active page does not change) + // assertEquals("event fired", 3, listener.getEventCount()); + // i=0; + // assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ACTIVATED, listener.getTraces().get(i++)); + + // Create a new page + IPageModel pageModel3 = new MessagePartModel("newPage3"); + contentProvider.addPage(pageModel3); + // Do refresh. This fire events + container.refreshTabs(); + + // check events (there is more than the 2 expected) + assertEquals("event fired", 3, listener.getEventCount()); + i = 0; + assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ABOUTTOBEOPENED, listener.getTraces().get(i++)); + assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_OPENED, listener.getTraces().get(i++)); + assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ACTIVATED, listener.getTraces().get(i++)); + + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageDeactivatedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} + * . + */ + @Test + public void testFirePageDeactivatedEvent() { + // Deactivated is no sent + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashContainerEventsProviderTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashContainerEventsProviderTest.java new file mode 100644 index 00000000000..30b7473084d --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashContainerEventsProviderTest.java @@ -0,0 +1,186 @@ +/** + * + */ +package org.eclipse.papyrus.infra.core.sasheditor.internal; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + + +/** + * Tests for the class {@link SashContainerEventsProvider}. + * + * @author dumoulin + * + */ +public class SashContainerEventsProviderTest /* extends AbstractPapyrusTest */{ + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#addListener(org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsListener)} + * . + */ + @Test + public void testAddActiveEditorChangedListener() { + SashContainerEventsProvider provider = new SashContainerEventsProvider(); + + FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); + provider.addListener(listener); + + // Use a null page, as it is not possible to instanciate a fake page. + PagePart page = null; + + // Send an event and check that it is received. If received, the listener is register ! + provider.firePageAboutToBeClosedEvent(page); + assertEquals("event fired", 1, listener.getEventCount()); + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#removeListener(org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsListener)} + * . + */ + @Test + public void testRemoveActiveEditorChangedListener() { + SashContainerEventsProvider provider = new SashContainerEventsProvider(); + + FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); + provider.addListener(listener); + provider.removeListener(listener); + + // Use a null page, as it is not possible to instanciate a fake page. + PagePart page = null; + + // Send an event and check that it is received. If received, the listener is register ! + provider.firePageAboutToBeClosedEvent(page); + assertEquals("event not fired", 0, listener.getEventCount()); + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageOpenedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} + * . + */ + @Test + public void testFirePageOpenedEvent() { + SashContainerEventsProvider provider = new SashContainerEventsProvider(); + + FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); + provider.addListener(listener); + + // Use a null page, as it is not possible to instanciate a fake page. + PagePart page = null; + + // Send an event and check that it is received. If received, the listener is register ! + provider.firePageOpenedEvent(page); + assertEquals("event fired", 1, listener.getEventCount()); + assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_OPENED, listener.getTraces().get(0)); + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageClosedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} + * . + */ + @Test + public void testFirePageClosedEvent() { + SashContainerEventsProvider provider = new SashContainerEventsProvider(); + + FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); + provider.addListener(listener); + + // Use a null page, as it is not possible to instanciate a fake page. + PagePart page = null; + + // Send an event and check that it is received. If received, the listener is register ! + provider.firePageClosedEvent(page); + assertEquals("event fired", 1, listener.getEventCount()); + assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_CLOSED, listener.getTraces().get(0)); + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageAboutToBeOpenedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} + * . + */ + @Test + public void testFirePageAboutToBeOpenedEvent() { + SashContainerEventsProvider provider = new SashContainerEventsProvider(); + + FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); + provider.addListener(listener); + + // Use a null page, as it is not possible to instanciate a fake page. + PagePart page = null; + + // Send an event and check that it is received. If received, the listener is register ! + provider.firePageAboutToBeOpenedEvent(page); + assertEquals("event fired", 1, listener.getEventCount()); + assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ABOUTTOBEOPENED, listener.getTraces().get(0)); + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageAboutToBeClosedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} + * . + */ + @Test + public void testFirePageAboutToBeClosedEvent() { + SashContainerEventsProvider provider = new SashContainerEventsProvider(); + + FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); + provider.addListener(listener); + + // Use a null page, as it is not possible to instanciate a fake page. + PagePart page = null; + + // Send an event and check that it is received. If received, the listener is register ! + provider.firePageAboutToBeClosedEvent(page); + assertEquals("event fired", 1, listener.getEventCount()); + assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ABOUTTOBECLOSED, listener.getTraces().get(0)); + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageActivatedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} + * . + */ + @Test + public void testFirePageActivatedEvent() { + SashContainerEventsProvider provider = new SashContainerEventsProvider(); + + FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); + provider.addListener(listener); + + // Use a null page, as it is not possible to instanciate a fake page. + PagePart page = null; + + // Send an event and check that it is received. If received, the listener is register ! + provider.firePageActivatedEvent(page); + assertEquals("event fired", 1, listener.getEventCount()); + assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_ACTIVATED, listener.getTraces().get(0)); + } + + /** + * Test method for + * {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashContainerEventsProvider#firePageDeactivatedEvent(org.eclipse.papyrus.infra.core.sasheditor.internal.PagePart)} + * . + */ + @Test + public void testFirePageDeactivatedEvent() { + SashContainerEventsProvider provider = new SashContainerEventsProvider(); + + FakePageLifeCycleEventsListener listener = new FakePageLifeCycleEventsListener(); + provider.addListener(listener); + + // Use a null page, as it is not possible to instanciate a fake page. + PagePart page = null; + + // Send an event and check that it is received. If received, the listener is register ! + provider.firePageDeactivatedEvent(page); + assertEquals("event fired", 1, listener.getEventCount()); + assertEquals("right event", FakePageLifeCycleEventsListener.PAGE_DEACTIVATED, listener.getTraces().get(0)); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerDisposeCalledTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerDisposeCalledTest.java new file mode 100644 index 00000000000..880e10c5008 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerDisposeCalledTest.java @@ -0,0 +1,177 @@ +/***************************************************************************** + * Copyright (c) 2012 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.internal; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.FakeMultiSashPageEditor; +import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.TestTextEditor; +import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.TextEditorPartModel; +import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.junit.After; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Tests to check memory leak and dispose() calls. + * + * @author Cedric Dumoulin + * + */ +public class SashWindowsContainerDisposeCalledTest /* extends AbstractPapyrusTest */{ + + /** + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + Display.getDefault().syncExec(new Runnable() { + + public void run() { + // Close all remaining opened editors + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + IWorkbenchPage page = window.getActivePage(); + page.closeAllEditors(false); + } + }); + } + + /** + * Test the call of dispose() on nestedEditor when the editor is + * closed independently + * + * * @throws PartInitException + * + * @throws Exception + */ + @Test + public void testDisposeCallOnNestedEditorRemoval() throws Exception { + // Create + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + + // Create pages and add them to the default folder + int pageCount = 3; + List models = new ArrayList(); + for(int i = 0; i < pageCount; i++) { + IPageModel newModel = new TextEditorPartModel("model" + i, true); + contentProvider.addPage(newModel); + models.add(newModel); + } + + + FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(contentProvider); + // Get the container + final SashWindowsContainer container = editor.getSashWindowsContainer(); + + // Check if nested editor creation work + IEditorPart activeNestedEditor = editor.getActiveEditor(); + assertEquals("nested editor is of right type", TestTextEditor.class, activeNestedEditor.getClass()); + + // // Close the editor by removing its model + // contentProvider.removePage(models.get(0)); + // // Refresh the container: this should close the editor + // container.refreshTabs(); + // assertNull( "No more active editor", container.getActiveEditor() ); + // // Check if dispose() is called + // ITraceRecords traces = ((TextEditorPartModel)models.get(0)).getTraceRecords(); + // assertTrue("dispose is called", traces.contains(null, "dispose")); + + // Close each container and check dispose call + for(IPageModel model : models) { + // Close the editor by removing its model + contentProvider.removePage(model); + // Refresh the container: this should close the editor + Display.getDefault().syncExec(new Runnable() { + + public void run() { + container.refreshTabs(); + } + }); + + // Check if dispose() is called + ITraceRecords traces = ((TextEditorPartModel)model).getTraceRecords(); + assertTrue("dispose is called", traces.contains(null, "dispose")); + + } + + FakeMultiSashPageEditor.closeEditor(editor); + + } + + /** + * Test if dispose can be called twice without errors. + * + * * @throws PartInitException + */ + @Ignore("TODO") + @Test + public void testCallingDisposeTwice() throws PartInitException { + //TODO + } + + /** + * Test the call of dispose() on nestedEditor when the main editor is + * closed. Normally, each nested editor should be disposed. + * + * * @throws PartInitException + */ + @Test + public void testDisposeCallOnMainEditorClose() throws PartInitException { + // Create + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + + // Create pages and add them to the default folder + int pageCount = 3; + List models = new ArrayList(); + for(int i = 0; i < pageCount; i++) { + IPageModel newModel = new TextEditorPartModel("model" + i, true); + contentProvider.addPage(newModel); + models.add(newModel); + } + + + FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(contentProvider); + + // Check if nested editor creation work + IEditorPart activeNestedEditor = editor.getActiveEditor(); + assertEquals("nested editor is of right type", TestTextEditor.class, activeNestedEditor.getClass()); + + // Close the main editor + FakeMultiSashPageEditor.closeEditor(editor); + + // for each container check dispose call + assertEquals("list of model is alive", pageCount, models.size()); + for(IPageModel model : models) { + // Check if dispose() is called + ITraceRecords traces = ((TextEditorPartModel)model).getTraceRecords(); + assertTrue("dispose nested editor is called when main editor close", traces.contains(null, "dispose")); + } + + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerMemoryLeakTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerMemoryLeakTest.java new file mode 100644 index 00000000000..7fa80e94860 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerMemoryLeakTest.java @@ -0,0 +1,207 @@ +/***************************************************************************** + * Copyright (c) 2012 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.internal; + +import static org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak.MemoryLeakUtil.assertIsGarbageCollected; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.FakeMultiSashPageEditor; +import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.TestTextEditor; +import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.TextEditorPartModel; +import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.junit.After; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Tests to check memory leak and dispose() calls. + * + * The test do not work because the {@link TestTextEditor} don not dispose properly. We need to find + * how to dispose it properly, or use another editor. + * + * @author Cedric Dumoulin + * + */ +@Ignore +public class SashWindowsContainerMemoryLeakTest { + + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + } + + /** + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + + if (PlatformUI.isWorkbenchRunning()) { + + // Close all remaining opened editors + IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + IWorkbenchPage page = window.getActivePage(); + page.closeAllEditors(false); + } + } + + /** + * Test if calling dispose on TestEditor do not induce memory leak. + * + * * @throws PartInitException + * @throws Exception + */ + @Test + public void testDisposeOnTestEditor() throws Exception { + + TestTextEditor editor = TestTextEditor.openEditor(); + + TestTextEditor.closeEditor(editor); + // Check memory leak + WeakReference ref = new WeakReference(editor); + editor = null; + assertIsGarbageCollected(ref, 10*1000); + + + } + + + /** + * Test the call of dispose() on nestedEditor when the editor is + * closed independently + * + * * @throws PartInitException + * @throws Exception + */ + @Test + @Ignore + public void testDisposeCallOnNestedEditorRemoval() throws Exception { + // Create + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + + // Create pages and add them to the default folder + int pageCount = 3; + List models = new ArrayList(); + for(int i = 0; i < pageCount; i++) { + IPageModel newModel = new TextEditorPartModel("model" + i, true); + contentProvider.addPage(newModel); + models.add(newModel); + } + + + FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(contentProvider); + // Get the container + SashWindowsContainer container = editor.getSashWindowsContainer(); + + // Check if nested editor creation work + IEditorPart activeNestedEditor = editor.getActiveEditor(); + assertEquals("nested editor is of right type", TestTextEditor.class, activeNestedEditor.getClass()); + +// // Close the editor by removing its model +// contentProvider.removePage(models.get(0)); +// // Refresh the container: this should close the editor +// container.refreshTabs(); +// assertNull( "No more active editor", container.getActiveEditor() ); +// // Check if dispose() is called +// ITraceRecords traces = ((TextEditorPartModel)models.get(0)).getTraceRecords(); +// assertTrue("dispose is called", traces.contains(null, "dispose")); + + // Close each container and check dispose call + for(IPageModel model : models) { + // Close the editor by removing its model + contentProvider.removePage(model); + // Refresh the container: this should close the editor + container.refreshTabs(); + // Check if dispose() is called + ITraceRecords traces = ((TextEditorPartModel)model).getTraceRecords(); + assertTrue("dispose is called", traces.contains(null, "dispose")); + + } + + // Check memory leak + editor = null; + WeakReference ref = new WeakReference(activeNestedEditor); + activeNestedEditor = null; + assertIsGarbageCollected(ref, 10*1000); + + FakeMultiSashPageEditor.closeEditor(editor); + + } + + /** + * Test the call of dispose() on nestedEditor when the main editor is + * closed. Normally, each nested editor should be disposed. + * + * * @throws PartInitException + */ + @Test + @Ignore + public void testDisposeCallOnMainEditorClose() throws PartInitException { + // Create + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + + // Create pages and add them to the default folder + int pageCount = 3; + List models = new ArrayList(); + for(int i = 0; i < pageCount; i++) { + IPageModel newModel = new TextEditorPartModel("model" + i, true); + contentProvider.addPage(newModel); + models.add(newModel); + } + + + FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(contentProvider); + + // Check if nested editor creation work + IEditorPart activeNestedEditor = editor.getActiveEditor(); + assertEquals("nested editor is of right type", TestTextEditor.class, activeNestedEditor.getClass()); + + // Close the main editor + FakeMultiSashPageEditor.closeEditor(editor); + editor = null; + + // for each container check dispose call + assertEquals("list of model is alive", pageCount, models.size()); + for(IPageModel model : models) { + // Check if dispose() is called + ITraceRecords traces = ((TextEditorPartModel)model).getTraceRecords(); + assertTrue("dispose is called", traces.contains(null, "dispose")); + } + + // Check memory leak + WeakReference ref = new WeakReference(activeNestedEditor); + activeNestedEditor = null; + assertIsGarbageCollected(ref, 10*1000); + + + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerRefreshTabsTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerRefreshTabsTest.java new file mode 100644 index 00000000000..96e2083fd1b --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerRefreshTabsTest.java @@ -0,0 +1,119 @@ +/***************************************************************************** + * Copyright (c) 2012 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.internal; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.editor.IPage; +import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.FakeMultiSashPageEditor; +import org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.TextEditorPartModel; +import org.eclipse.swt.SWT; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the correct execution of {@link SashWindowsContainer#refreshTabs()} on particular + * configuration of the model. + * + * @author Cedric Dumoulin + * + */ +public class SashWindowsContainerRefreshTabsTest { + + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + } + + /** + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + + // Close all remaining opened editors + IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + IWorkbenchPage page = window.getActivePage(); + page.closeAllEditors(false); + } + + /** + * Test that closing the last editor in a second folder correctly close the folder. + * + * * @throws PartInitException + * @throws Exception + */ + @Test + public void testCloseLastEditorInSecondFolder() throws Exception { + // Create + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + + // Create pages and add them to the default folder + int pageCount = 3; + List models = new ArrayList(); + for(int i = 0; i < pageCount; i++) { + IPageModel newModel = new TextEditorPartModel("model" + i, true); + contentProvider.addPage(newModel); + models.add(newModel); + } + + // Create the Main editor + FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(contentProvider); + // Get the container + SashWindowsContainer container = editor.getSashWindowsContainer(); + + // Index of the model of the editor to move and close + int movedEditorModelIndex = 0; + // Create a new folder by moving an editor + ITabFolderModel firstFolder = contentProvider.getCurrentTabFolder(); + contentProvider.createFolder(firstFolder, movedEditorModelIndex, firstFolder, SWT.TOP); + + // Refresh + container.refreshTabs(); + + // Check if nested editor is the moved one + IPage page = container.getActiveSashWindowsPage(); + assertEquals("nested editor is of right type", models.get(movedEditorModelIndex), page.getRawModel()); + + + // Close the editor + contentProvider.removePage(models.get(movedEditorModelIndex)); + + // Refresh + try { + container.refreshTabs(); + } catch (Exception e) { + fail("refreshTabs() work correctly"); + } + + FakeMultiSashPageEditor.closeEditor(editor); + + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerTest.java new file mode 100644 index 00000000000..486e1b41961 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/SashWindowsContainerTest.java @@ -0,0 +1,643 @@ +/***************************************************************************** + * Copyright (c) 2009-2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.internal; + +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.folder; +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.page; +import static org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.SashPagesModelFactory.vSash; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import org.eclipse.jface.action.MenuManager; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ITabFolderModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContainerTestFacade; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowContentProviderUtils; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; +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.IFolder; +import org.eclipse.papyrus.infra.core.sasheditor.editor.IPage; +import org.eclipse.papyrus.infra.core.sasheditor.editor.IPageVisitor; +import org.eclipse.papyrus.infra.core.sasheditor.editor.MessagePartModel; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; +import org.eclipse.papyrus.infra.core.sasheditor.utils.FakeObservableListener; +import org.eclipse.papyrus.infra.core.sasheditor.utils.IObservableList; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Run as normal test. + * + * @author cedric dumoulin + * + */ +public class SashWindowsContainerTest /* extends AbstractPapyrusTest */{ + + + protected Display display; + + /** + * Constructor. + * + * @param name + */ + public SashWindowsContainerTest() { + } + + /** + * @see junit.framework.TestCase#setUp() + * @throws java.lang.Exception + * + */ + @Before + public void setUp() throws Exception { + display = Display.getCurrent(); + if(display == null) { + display = new Display(); + } + } + + /** + * Create a {@link SashWindowsContainer} to test. Initialize it with provided {@link ISashWindowsContentProvider}. + * + * @param contentProvider + * @return + */ + protected SashWindowsContainer createSashWindowsContainer(ISashWindowsContentProvider contentProvider) { + Shell shell = new Shell(display); + shell.setLayout(new FillLayout()); + + // + //new ShellEditor(shell); + SashWindowsContainer sashWindowContainer = new SashWindowsContainer(); + + sashWindowContainer.setContentProvider(contentProvider); + + sashWindowContainer.createPartControl(shell); + // shell.open(); + return sashWindowContainer; + } + + /** + * Create a contentProvider. + * + * @return + */ + protected ISashWindowsContentProvider createContentProvider() { + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + + // Create pages and add them to the default folder + List models = new ArrayList(); + for(int i = 0; i < 8; i++) { + IPageModel newModel = new MessagePartModel("model" + i); + contentProvider.addPage(newModel); + models.add(newModel); + } + + return contentProvider; + } + + /** + * Test the method on a model with several folders and page. + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#getActiveEditor()}. + */ + @Test + public void testGetActiveEditor() { + // Create + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + + // Create pages and add them to the default folder + List models = new ArrayList(); + for(int i = 0; i < 2; i++) { + IPageModel newModel = new MessagePartModel("model" + i); + contentProvider.addPage(newModel); + models.add(newModel); + } + + // Create new folder + ITabFolderModel folder = contentProvider.getCurrentTabFolder(); + contentProvider.createFolder(folder, 1, folder, SWT.TOP); + + // Get the active editor + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + IPage page = container.getActiveSashWindowsPage(); + assertNotNull("Page exist", page); + } + + /** + * Test the method on a model with several folders and page. + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#getActiveEditor()}. + * Use new implementation to populate contentProvider + * + * @throws PagesModelException + */ + @Test + public void testGetActiveEditor2() throws PagesModelException { + + // Create populated content provider + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); + + // define how to populate contentProvider + IModelExp expr = vSash(folder("f1", page("p11"), page("p12")), folder("f2", page("p21"))); + // Try to create the model + helper.createModel(expr); + + + // Get the active editor + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + IPage page = container.getActiveSashWindowsPage(); + assertNotNull("Page exist", page); + } + + /** + * Test the method on a model with several folders and page. + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#getActiveEditor()}. + */ + @Test + public void testGetVisiblePages() { + // Create + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + + // Create pages and add them to the default folder + List models = new ArrayList(); + for(int i = 0; i < 2; i++) { + IPageModel newModel = new MessagePartModel("model" + i); + contentProvider.addPage(newModel); + models.add(newModel); + } + + // Create new folder + ITabFolderModel folder = contentProvider.getCurrentTabFolder(); + contentProvider.createFolder(folder, 1, folder, SWT.TOP); + // Add pages + List modelsInFolder2 = new ArrayList(); + for(int i = 0; i < 2; i++) { + IPageModel newModel = new MessagePartModel("modelInFolder2" + i); + contentProvider.addPage(newModel); + modelsInFolder2.add(newModel); + } + + // Build a list of expected visible models + List expectedVisibleModel = new ArrayList(); + expectedVisibleModel.add(models.get(models.size() - 1)); + expectedVisibleModel.add(modelsInFolder2.get(models.size() - 1)); + + // Get the active editor + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + List pages = container.getVisiblePages(); + + assertEquals("2 pages visible", 2, pages.size()); + assertTrue("contains active from folder 1", expectedVisibleModel.contains(pages.get(0).getRawModel())); + assertTrue("contains active from folder 1", expectedVisibleModel.contains(pages.get(1).getRawModel())); + // assertNotNull("Page exist", page); + } + + /** + * Test the method on a model with several folders and page. + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#getActiveEditor()}. + * Use new implementation to populate contentProvider + * + * @throws PagesModelException + */ + @Test + public void testGetVisiblePages2() throws PagesModelException { + // Create populated content provider + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); + + // define how to populate contentProvider + IModelExp expr = vSash(folder("f1", page("p11"), page("p12")), folder("f2", page("p21"), page("p22"))); + // Try to create the model + helper.createModel(expr); + // Get the references + Map models = helper.queryModel(expr); + + + // Create the container + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + // Get visible pages + List pages = container.getVisiblePages(); + // Build a list of raw models + List visibleModels = new ArrayList(); + for(IPage page : pages) { + visibleModels.add(page.getRawModel()); + } + + assertEquals("2 pages visible", 2, pages.size()); + assertTrue("contains active page from folder 1", visibleModels.contains(models.get("p11"))); + assertTrue("contains active page from folder 2", visibleModels.contains(models.get("p22"))); + + // Check orders + assertEquals(models.get("p11"), pages.get(0).getRawModel()); + assertEquals(models.get("p22"), pages.get(1).getRawModel()); + } + + /** + * Test the method on a model with only one folder. + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#getActiveEditor()}. + * Use new implementation to populate contentProvider + * + * @throws PagesModelException + */ + @Test + public void testGetVisiblePagesOneFoler() throws PagesModelException { + // Create populated content provider + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); + + // define how to populate contentProvider + IModelExp expr = folder("f1", page("p11"), page("p12"), page("p13")); + // Try to create the model + helper.createModel(expr); + // Get the references + Map models = helper.queryModel(expr); + + + // Create the container + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + // Get visible pages + List pages = container.getVisiblePages(); + // Build a list of raw models + List visibleModels = new ArrayList(); + for(IPage page : pages) { + visibleModels.add(page.getRawModel()); + } + + assertEquals("1 pages visible", 1, pages.size()); + assertTrue("contains active page from folder 1", visibleModels.contains(models.get("p11"))); + + // Check orders + assertEquals(models.get("p11"), pages.get(0).getRawModel()); + } + + /** + * Test the method on a model with no pages. + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#getActiveEditor()}. + */ + @Test + public void testGetActiveEditorNoPage() { + // Create + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + + + // Get the active editor + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + IPage page = container.getActiveSashWindowsPage(); + assertNull("No Page exist", page); + } + + /** + * Test the method on a model with several folders and page. + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#selectPage(IPage)}. + * Use new implementation to populate contentProvider + * + * @throws PagesModelException + */ + @Test + public void testSelectPage() throws PagesModelException { + // Create populated content provider + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); + + // define how to populate contentProvider + IModelExp expr = vSash(folder("f1", page("p11"), page("p12"), page("p13"), page("p14")), folder("f2", page("p21"), page("p22"))); + // Try to create the model + helper.createModel(expr); + // Get the references + Map models = helper.queryModel(expr); + + + // Create the container + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + + // Check if we have an active page + assertNotNull("active page set", container.getActiveSashWindowsPage()); + + // Try to set active page + IPage p12 = container.lookupModelPage(models.get("p12")); + container.selectPage(p12); + assertEquals("page selected", p12, container.getActiveSashWindowsPage()); + + // Try to set active page + IPage p22 = container.lookupModelPage(models.get("p22")); + container.selectPage(p22); + assertEquals("page selected", p22, container.getActiveSashWindowsPage()); + + // Try to set active page + IPage p11 = container.lookupModelPage(models.get("p11")); + container.selectPage(p11); + assertEquals("page selected", p11, container.getActiveSashWindowsPage()); + } + + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#refreshTabs()}. + */ + @Test + public void testRefreshTabs() { + + ISashWindowsContentProvider contentProvider = createContentProvider(); + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + + container.refreshTabs(); + assertNotNull("container is set", container); + + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer#refreshTabs()}. + */ + @Test + public void testRefreshTabs2() { + + // Test 2 folders, one tab each. Then supress one tabs. + // 1 folder with one tab should remain. + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + + // Create pages and add them to the default folder + List models = new ArrayList(); + for(int i = 0; i < 2; i++) { + IPageModel newModel = new MessagePartModel("model" + i); + contentProvider.addPage(newModel); + models.add(newModel); + } + + // Create new folder + ITabFolderModel folder = contentProvider.getCurrentTabFolder(); + contentProvider.createFolder(folder, 1, folder, SWT.TOP); + + // Create the container + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + container.refreshTabs(); + assertNotNull("container is set", container); + + } + + /** + * Test method for {@link SashWindowsContainer#visit(org.eclipse.papyrus.infra.core.sasheditor.editor.IPageVisitor)} + */ + @Test + public void testVisit() { + // Create + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + + // Create pages and add them to the default folder + List models = new ArrayList(); + for(int i = 0; i < 2; i++) { + IPageModel newModel = new MessagePartModel("model" + i); + contentProvider.addPage(newModel); + models.add(newModel); + } + + // Create new folder + ITabFolderModel folder = contentProvider.getCurrentTabFolder(); + contentProvider.createFolder(folder, 1, folder, SWT.TOP); + + // Get the active editor + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + + CollectRawModelVisitor pageVisitor = new CollectRawModelVisitor(); + container.visit(pageVisitor); + + // Check each elements + Collection results = pageVisitor.collected; + assertEquals("list are of same size", models.size(), results.size()); + for(Object model : models) { + assertTrue("model is in the collected list", results.contains(model)); + } + } + + protected class CollectRawModelVisitor implements IPageVisitor { + + Collection collected = new ArrayList(); + + public void accept(IComponentPage page) { + collected.add(page.getRawModel()); + } + + public void accept(IEditorPage page) { + collected.add(page.getRawModel()); + } + } + + /** + * Test the lookup of a page by its raw model + * Test method for {@link SashWindowsContainer#lookupModelPage(Object)} + */ + @Test + public void testlookupModelPage() { + // Create + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + + // Create pages and add them to the default folder + List models = new ArrayList(); + for(int i = 0; i < 2; i++) { + IPageModel newModel = new MessagePartModel("model" + i); + contentProvider.addPage(newModel); + models.add(newModel); + } + + // Create new folder + ITabFolderModel folder = contentProvider.getCurrentTabFolder(); + contentProvider.createFolder(folder, 1, folder, SWT.TOP); + + // Get the active editor + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + + Object model = models.get(1); + IPage foundPage = container.lookupModelPage(model); + assertEquals("Corresponding page is found", foundPage.getRawModel(), model); + } + + /** + * Test method for {@link SashWindowsContainer#setFolderTabMenuManager(MenuManager)} + */ + @Test + public void testSetFolderTabMenuManager_MenuManager() { + // Create + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + + // Create pages and add them to the default folder + List models = new ArrayList(); + for(int i = 0; i < 2; i++) { + IPageModel newModel = new MessagePartModel("model" + i); + contentProvider.addPage(newModel); + models.add(newModel); + } + + // Create new folders + ITabFolderModel referenceFolder = contentProvider.getCurrentTabFolder(); + ITabFolderModel folder1 = contentProvider.createFolder(referenceFolder, SWT.TOP); + ITabFolderModel folder2 = contentProvider.createFolder(referenceFolder, SWT.DOWN); + ITabFolderModel folder3 = contentProvider.createFolder(referenceFolder, SWT.LEFT); + + // Create SashWindowsContainer + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + // Set a MenuManager + MenuManager menuManager = new MenuManager(); + container.setFolderTabMenuManager(menuManager); + + // Test if the menu has been set in already created folders. + TabFolderPart folderPart = lookupTabFolderPart(container, referenceFolder); + assertNotNull("menu exist", folderPart.getControl().getMenu()); + + folderPart = lookupTabFolderPart(container, folder1); + assertNotNull("menu exist", folderPart.getControl().getMenu()); + + folderPart = lookupTabFolderPart(container, folder2); + assertNotNull("menu exist", folderPart.getControl().getMenu()); + + folderPart = lookupTabFolderPart(container, folder3); + assertNotNull("menu exist", folderPart.getControl().getMenu()); + + + // Now create another tab, refresh the container in order that the part is created, + // ant test it + ITabFolderModel folder4 = contentProvider.createFolder(referenceFolder, SWT.RIGHT); + container.refreshTabs(); + + folderPart = lookupTabFolderPart(container, folder4); + assertNotNull("menu exist", folderPart.getControl().getMenu()); + + } + + @Ignore("TODO") + @Test + public void testSelectPagePageId() { + //TODO + } + + protected TabFolderPart lookupTabFolderPart(SashWindowsContainer container, Object rawModel) { + + LookupFolderPartByRawModelVisitor visitor = new LookupFolderPartByRawModelVisitor(rawModel); + container.visit(visitor); + return visitor.result(); + } + + /** + * Test If the FolderList is properly populated. + * + * * @throws PagesModelException + */ + @Test + public void testFolderList() throws PagesModelException { + // Create populated content provider + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + SimpleSashWindowContentProviderUtils helper = new SimpleSashWindowContentProviderUtils(contentProvider); + + // define how to populate contentProvider + IModelExp expr = vSash(folder("f1", page("p11"), page("p12")), folder("f2", page("p21"), page("p22"))); + // Try to create the model + helper.createModel(expr); + // Get the references + Map models = helper.queryModel(expr); + + // Create the container + SashWindowsContainer container = createSashWindowsContainer(contentProvider); + + // Check the folder list + IObservableList list = container.getIFolderList(); + // Listener on the list + FakeObservableListener listener = new FakeObservableListener(); + list.addListener(listener); + + // Check list before + assertNotNull("List exist", list); + assertEquals("list size", 2, list.size()); + + // create a folder + ITabFolderModel folder = (ITabFolderModel)models.get("f2"); + assertNotNull("folder found", folder); + contentProvider.createFolder(folder, 0, folder, SWT.UP); + // Refresh tabs, so that tabfolder is created. + container.refreshTabs(); + + // Check if the list contains the new folder + assertEquals("list size", 3, list.size()); + // check event fired + assertNotNull("event sent", listener.getLastAddEvents()); + // assertEquals( "event sent", folder, listener.getLastAddEvents().getRawModel() ); + + } + + /** + * Test If the FolderList is properly populated. + * + * * @throws PagesModelException + */ + @Test + public void testFolderList2() throws PagesModelException { + + SimpleSashWindowContainerTestFacade containerFacade = new SimpleSashWindowContainerTestFacade(); + + // define how to populate contentProvider + IModelExp expr = vSash(folder("f1", page("p11"), page("p12")), folder("f2", page("p21"), page("p22"))); + // Try to create the model + containerFacade.createModel(expr); + + // Create the container + SashWindowsContainer container = containerFacade.getSashContainer(); + + // Refresh container, so that pages are created. + container.refreshTabs(); + + // Check the folder list + IObservableList list = container.getIFolderList(); + // Listener on the list + FakeObservableListener listener = new FakeObservableListener(); + list.addListener(listener); + + // Check list before + assertNotNull("List exist", list); + assertEquals("list size", 2, list.size()); + + // create a folder + containerFacade.createFolder("f2", 0, "f2", SWT.UP); + // Refresh tabs, so that tabfolder is created. + container.refreshTabs(); + + // build expr corresponding to new configuration + IModelExp newExpr = vSash(folder("f1", page("p11"), page("p12")), vSash(folder("f3", page("p21")), folder("f2", page("p22")))); + // Reset facade names to correspond to new configuration. + containerFacade.resetNamesContext(newExpr); + ITabFolderModel folder = containerFacade.getITabFolderModel("f3"); + + // Check if the list contains the new folder + assertEquals("list size", 3, list.size()); + + + // check event fired + assertNotNull("event sent", listener.getLastAddEvents()); + assertEquals("event sent", folder, listener.getLastAddEvents().getRawModel()); + + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/TabFolderListManagerTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/TabFolderListManagerTest.java new file mode 100644 index 00000000000..5b993121155 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/internal/TabFolderListManagerTest.java @@ -0,0 +1,95 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.internal; + +import static org.junit.Assert.*; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + + +/** + * Tests for the {@link SashContainerFolderEventsProvider} class. + * @author cedric dumoulin + * + */ +public class TabFolderListManagerTest { + + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + } + + /** + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + } + + /** + * Test addition of a folder. Check if the folder is added to the list, and event added. + * + */ + @Test + public void testFolderAdded() { + + // Create listManager and folder event provider + TabFolderListManager listManager = new TabFolderListManager(); + SashContainerFolderEventsProvider folderEventProvider = new SashContainerFolderEventsProvider(); + folderEventProvider.addListener(listManager); + + // fire folder added event + TabFolderPart folder1= new FakeTabFolderPart(); + folderEventProvider.fireFolderCreatedEvent(folder1); + + // Check the list + assertTrue( "folder added", listManager.getFolderList().contains(folder1) ); + + } + + /** + * Test addition of a folder. Check if the folder is added to the list, and event added. + */ + @Test + public void testFolderRemoved() { + // Create listManager and folder event provider + TabFolderListManager listManager = new TabFolderListManager(); + SashContainerFolderEventsProvider folderEventProvider = new SashContainerFolderEventsProvider(); + folderEventProvider.addListener(listManager); + + // fire folder added event + TabFolderPart folder1= new FakeTabFolderPart(); + folderEventProvider.fireFolderCreatedEvent(folder1); + + TabFolderPart folder2= new FakeTabFolderPart(); + folderEventProvider.fireFolderCreatedEvent(folder2); + + // Check the list + assertTrue( "folder added", listManager.getFolderList().contains(folder1) ); + assertTrue( "folder added", listManager.getFolderList().contains(folder2) ); + + // remove the folder + folderEventProvider.fireFolderDisposedEvent(folder1); + assertFalse( "folder removed", listManager.getFolderList().contains(folder1) ); + assertTrue( "folder added", listManager.getFolderList().contains(folder2) ); + + + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/AbstractSash.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/AbstractSash.java new file mode 100644 index 00000000000..57e22ecce0d --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/AbstractSash.java @@ -0,0 +1,95 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + + +/** + * Base class for structure representing sash in Checker + * @author cedric dumoulin + * + */ +public abstract class AbstractSash extends PanelTerm { + + protected PanelTerm leftup; + protected PanelTerm rightdown; + + /** + * Constructor. + * + */ + public AbstractSash(PanelTerm left, PanelTerm right) { + this.leftup = left; + this.rightdown = right; + } + + /** + * Constructor. + * + * @param name + * @param up + * @param down + */ + public AbstractSash(String name, PanelTerm left, PanelTerm right) { + super(name); + this.leftup = left; + this.rightdown = right; + } + + /** + * @return the leftup + */ + public PanelTerm getLeftup() { + return leftup; + } + + /** + * @return the rightdown + */ + public PanelTerm getRightdown() { + return rightdown; + } + + /** + * + * @param visitor + * @throws PagesModelException + */ + abstract public void accept(IPagesModelVisitor visitor, M modelObject) throws PagesModelException ; + + /** + * @return The name used in toString + */ + protected abstract String getStringName(); + + /** + * @see java.lang.Object#toString() + * + * @return + */ + @Override + public String toString() { + + StringBuffer buff = new StringBuffer(getStringName()); + + buff.append("("); + buff.append(leftup.toString()); + buff.append(", "); + buff.append(rightdown.toString()); + buff.append(")"); + + return buff.toString(); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/BadNameException.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/BadNameException.java new file mode 100644 index 00000000000..7bc18bbf52f --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/BadNameException.java @@ -0,0 +1,82 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + + + +/** + * @author cedric dumoulin + * + */ +public class BadNameException extends PagesModelException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + */ + public BadNameException() { + // TODO Auto-generated constructor stub + } + + /** + * Constructor. + * + * @param arg0 + */ + public BadNameException(String arg0) { + super(arg0); + // TODO Auto-generated constructor stub + } + + /** + * Constructor. + * + * @param arg0 + */ + public BadNameException(Throwable arg0) { + super(arg0); + // TODO Auto-generated constructor stub + } + + /** + * Constructor. + * + * @param arg0 + * @param arg1 + */ + public BadNameException(String arg0, Throwable arg1) { + super(arg0, arg1); + // TODO Auto-generated constructor stub + } + + /** + * Constructor. + * + * @param arg0 + * @param arg1 + * @param arg2 + * @param arg3 + */ + public BadNameException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { + super(arg0, arg1, arg2, arg3); + // TODO Auto-generated constructor stub + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Folder.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Folder.java new file mode 100644 index 00000000000..9bde0efcfa4 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Folder.java @@ -0,0 +1,90 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + +import java.util.Arrays; +import java.util.List; + +/** + * This represent a Folder in the Checker query. + * + * @author cedric dumoulin + */ +public class Folder extends PanelTerm implements IModelObject { + + protected List pages; + + /** + * Constructor. + * + */ + public Folder(Page ... pages) { + this.pages = Arrays.asList(pages); + } + + /** + * Constructor. + * + */ + public Folder(String name, Page ... pages) { + super(name); + this.pages = Arrays.asList(pages); + } + + /** + * @return the pages + */ + public List getPages() { + return pages; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.IModelObject.sashmodel.query.IQueryTerm#accept(IPagesModelVisitor, EObject) + * + * @param visitor + * @throws PagesModelException + */ + public void accept(IPagesModelVisitor visitor, M modelObject) throws PagesModelException { + + visitor.walk(this, modelObject); + } + + /** + * @see java.lang.Object#toString() + * + * @return + */ + @Override + public String toString() { + + StringBuffer buff = new StringBuffer("Folder("); + + if( getName() != null ) { + buff.append(getName()).append(", "); + } + + for(Page page : pages ) { + buff.append(page.toString()).append(", "); + } + // Remove extra , + int length = buff.length(); + if(buff.charAt(length-1) == ' ') { + buff.delete(length-2, length ); + } + buff.append(")"); + + return buff.toString(); + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/HSash.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/HSash.java new file mode 100644 index 00000000000..ef8abc77019 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/HSash.java @@ -0,0 +1,66 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + + +/** + * @author dumoulin + * + */ +public class HSash extends AbstractSash { + + /** + * Constructor. + * + * @param leftup + * @param rightdown + */ + public HSash(PanelTerm up, PanelTerm down) { + super(up, down); + } + + /** + * Constructor. + * + * @param leftup + * @param rightdown + */ + public HSash(String name, PanelTerm up, PanelTerm down) { + super(name, up, down); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.IModelObject.sashmodel.query.IQueryTerm#accept(IPagesModelVisitor, EObject) + * + * @param visitor + * @throws PagesModelException + */ + public void accept(IPagesModelVisitor visitor, M modelObject) throws PagesModelException { + + visitor.walk(this, modelObject); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.AbstractSash#getStringName() + * + * @return + */ + @Override + protected String getStringName() { + return "HSash"; + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelExp.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelExp.java new file mode 100644 index 00000000000..f516561baa7 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelExp.java @@ -0,0 +1,28 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + +/** + * A Model Expression represent an expression used to describe a PagesModel. + * Term implementing this interface can be used as starting point of expression. + *
+ * Following classses are expressions: {@link PanelTerm}, {@link WindowTerm}, {@link PagesModel}. + * + * @author cedric dumoulin + * TODO Rename to IModelExp + */ +public interface IModelExp extends IModelObject { + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelObject.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelObject.java new file mode 100644 index 00000000000..7692bdd3741 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IModelObject.java @@ -0,0 +1,38 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + + +/** + * Common ancestor of all object in the Model. + * All object that can be used in a query should implement this interface. + * + * @author cedric dumoulin + */ +public interface IModelObject { + + /** + * Visit the query. + * @param visitor + * @throws PagesModelException + */ + public void accept(IPagesModelVisitor visitor, M panel) throws PagesModelException; + + /** + * Get the name associated to the query part. + * Can return null; + */ + public String getName(); +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IPagesModelVisitor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IPagesModelVisitor.java new file mode 100644 index 00000000000..f0ef7e170df --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/IPagesModelVisitor.java @@ -0,0 +1,68 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + +/** + * Visitor used to visit pagemodel structure. + * + * @author cedric dumoulin + * + * @param M Type of the models provided to visit() and walk(). This is the common + * ancestor of all types of the walked model. + * + */ +public interface IPagesModelVisitor { + + /** + * If true, parent are visited before children. + * If false, parent are visited after children. + * @return + */ + public boolean isVisitingParentFirst(); + + /** + * Walk the node and its children. Call visit visit method appropiatly. + * This method encapsulate the navigation between nodes. + * + * @param windowTerm The term to navigate + * @param windowModel the model that maybe correspond to the term. + * @throws PagesModelException + * + */ + public void walk( SashPagesModel windowTerm, M windowModel ) throws PagesModelException; + public void walk( WindowTerm windowTerm, M windowModel ) throws PagesModelException; + public void walk( Folder folder, M folderModel ) throws PagesModelException; + + public void walk(HSash sash, M sashModel) throws PagesModelException; + public void walk(VSash sash, M sashModel) throws PagesModelException; + + public void walk(Page page, M pageModel) throws PagesModelException; + + + /** + * Visit the corresponding term. + * @param windowTerm The term to visit + * @param windowModel The corresponding model found while walking the expr. + */ +// public void visit( SashPagesModel windowTerm, M windowModel ) throws PagesModelException; +// public void visit( WindowTerm windowTerm, M windowModel ) throws PagesModelException; +// public void visit( Folder folder, M folderModel ) throws PagesModelException; +// +// public void visit(HSash sash, M sashModel) throws PagesModelException; +// public void visit(VSash sash, M sashModel) throws PagesModelException; +// +// public void visit(Page page, M pageModel) throws PagesModelException; + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NoMatchException.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NoMatchException.java new file mode 100644 index 00000000000..b5df2266c75 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NoMatchException.java @@ -0,0 +1,77 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + +/** + * Exception thrown when a query part does not match a modelpart. + * + * @author cedric dumoulin + * + */ +public class NoMatchException extends PagesModelException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + */ + public NoMatchException() { + } + + /** + * Constructor. + * + * @param arg0 + */ + public NoMatchException(String arg0) { + super(arg0); + } + + /** + * Constructor. + * + * @param arg0 + */ + public NoMatchException(Throwable arg0) { + super(arg0); + } + + /** + * Constructor. + * + * @param arg0 + * @param arg1 + */ + public NoMatchException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + + /** + * Constructor. + * + * @param arg0 + * @param arg1 + * @param arg2 + * @param arg3 + */ + public NoMatchException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { + super(arg0, arg1, arg2, arg3); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NotFoundException.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NotFoundException.java new file mode 100644 index 00000000000..5efb1e54db5 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/NotFoundException.java @@ -0,0 +1,82 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + + +/** + * @author cedric dumoulin + * + */ +public class NotFoundException extends PagesModelException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + */ + public NotFoundException() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * Constructor. + * + * @param arg0 + * @param arg1 + * @param arg2 + * @param arg3 + */ + public NotFoundException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { + super(arg0, arg1, arg2, arg3); + // TODO Auto-generated constructor stub + } + + /** + * Constructor. + * + * @param arg0 + * @param arg1 + */ + public NotFoundException(String arg0, Throwable arg1) { + super(arg0, arg1); + // TODO Auto-generated constructor stub + } + + /** + * Constructor. + * + * @param arg0 + */ + public NotFoundException(String arg0) { + super(arg0); + // TODO Auto-generated constructor stub + } + + /** + * Constructor. + * + * @param arg0 + */ + public NotFoundException(Throwable arg0) { + super(arg0); + // TODO Auto-generated constructor stub + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Page.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Page.java new file mode 100644 index 00000000000..4eb56723c9f --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/Page.java @@ -0,0 +1,116 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + + +/** + * This represent a page in the Checker query. + * + * @author cedric dumoulin + * + */ +public class Page implements IModelObject { + + protected Object identifier; + + protected String name; + + /** To generate automatic name */ + static int count=1; + + /** + * Constructor. + * + */ + public Page() { + // Automatic name generation + this( "page"+count++); + } + + /** + * Constructor. + * + * @param identifier + */ + public Page(Object identifier) { + this.identifier = identifier; + this.name = identifier.toString(); + } + + /** + * Constructor. + * + * @param name + * @param identifier + */ + public Page(String name) { + this.name = name; + this.identifier = name; + } + + /** + * Constructor. + * + * @param name + * @param identifier + */ + public Page(String name, Object identifier) { + this.name = name; + this.identifier = identifier; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.IModelObject.sashmodel.query.IQueryTerm#accept(IPagesModelVisitor, EObject) + * + * @param visitor + * @throws PagesModelException + */ + public void accept(IPagesModelVisitor visitor, M modelObject) throws PagesModelException { + + visitor.walk(this, modelObject); + } + + /** + * @return the identifier + */ + public Object getIdentifier() { + return identifier; + } + + /** + * @param identifier the identifier to set + */ + public void setIdentifier(Object identifier) { + this.identifier = identifier; + } + + /** + * @see java.lang.Object#toString() + * + * @return + */ + @Override + public String toString() { + + return "Page()"; + } + + /** + * @return the name + */ + public String getName() { + return name; + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PagesModelException.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PagesModelException.java new file mode 100644 index 00000000000..3d880b331fc --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PagesModelException.java @@ -0,0 +1,78 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + +/** + * Root Exception of the pagesmodel package + * + * @author cedric dumoulin + * + * TODO Rename to PagesModelException + */ +public class PagesModelException extends Exception { + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + */ + public PagesModelException() { + } + + /** + * Constructor. + * + * @param arg0 + */ + public PagesModelException(String arg0) { + super(arg0); + } + + /** + * Constructor. + * + * @param arg0 + */ + public PagesModelException(Throwable arg0) { + super(arg0); + } + + /** + * Constructor. + * + * @param arg0 + * @param arg1 + */ + public PagesModelException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + + /** + * Constructor. + * + * @param arg0 + * @param arg1 + * @param arg2 + * @param arg3 + */ + public PagesModelException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { + super(arg0, arg1);//, arg2, arg3); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PanelTerm.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PanelTerm.java new file mode 100644 index 00000000000..ebd4e7d7ade --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/PanelTerm.java @@ -0,0 +1,74 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + + +/** + * Common ancestor of Panel (Folder and Sash) in queries structure. + *
+ * This class can also be used a starting point of query expression (and so Folder, VSash and HSash). + * + * @author cedric dumoulin + * + */ +public abstract class PanelTerm implements IModelExp { + + protected String name; + + + /** + * Constructor. + * + */ + public PanelTerm() { + } + + /** + * Constructor. + * + * @param name + */ + public PanelTerm(String name) { + this.name = name; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.IModelObject.sashmodel.query.IQueryTerm#accept(org.eclipse.papyrus.infra.core.sasheditor.IPagesModelVisitor.sashmodel.query.IQueryVisitor, org.eclipse.emf.ecore.EObject) + * + * @param visitor + * @param panel + * @throws PagesModelException + */ + public void accept(IPagesModelVisitor visitor, M panel) + throws PagesModelException { + // TODO Auto-generated method stub + + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModel.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModel.java new file mode 100644 index 00000000000..14e771b9e57 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModel.java @@ -0,0 +1,103 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + +import java.util.ArrayList; +import java.util.List; + +/** + * Sash Pages model allow to create a models of the pages represented by the {@link SashWindowsContainer}. + * Such model can then be used to create corresponding pages and intermediate artifact in a {@link ISashWindowsContentProvider}, + * or to check the structure, .... + * + *
+ * The model contains windows. Actually, the {@link SashWindowsContainer} only support one window. + * + * @author cedric dumoulin + * + */ +public class SashPagesModel implements IModelExp { + + /** + * A window have only one panel. + */ + protected List windows = new ArrayList(); + + protected String name; + + /** + * Constructor. + * + * @param panel + */ + public SashPagesModel(WindowTerm window) { + this.windows.add(window); + } + + /** + * Constructor. + * + * @param name + * @param panel + */ + public SashPagesModel(String name, WindowTerm window) { + this.name = name; + this.windows.add(window); + } + + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.IModelObject.sashmodel.query.IQueryTerm#accept(org.eclipse.papyrus.infra.core.sasheditor.IPagesModelVisitor.sashmodel.query.IQueryVisitor, org.eclipse.emf.ecore.EObject) + * + * @param visitor + * @param panel + * @throws PagesModelException + */ + public void accept(IPagesModelVisitor visitor, M model) throws PagesModelException { + + visitor.walk(this, model); + + } + + + /** + * @return the panel + * @throws PagesModelException + */ + public WindowTerm getFirstWindow() throws PagesModelException { + if( windows.size() >0) { + return windows.get(0); + } + + // no elements + throw new PagesModelException("No window found in model."); + } + + /** + * @return the panel + */ + public List getWindows() { + return windows; + } + + + /** + * @return the name + */ + public String getName() { + return name; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModelFactory.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModelFactory.java new file mode 100644 index 00000000000..24611c6428c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/SashPagesModelFactory.java @@ -0,0 +1,98 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + + +/** + * This class provides a set of static constructor helping in writing model. + *
+ * Examples: + *
    + *
  • PanelTerm query = folder("a", page(), page() );
  • + *
  • query = hSash( folder( page("p1"), page() ), vSash("s2", folder( page() ), folder( page() )) );
  • + *
  • PanelTerm query = hSash( folder("f1", page("p1"), page("p2"), page("p3") ), folder("f2", page("p4") ) );
  • + *
  • + *
+ * + * @author cedric dumoulin + * + */ +public class SashPagesModelFactory { + + /** + * Static constructor for {@link Page}. + * @return + */ + static public Page page() { + return new Page(); + } + + /** + * Static constructor for {@link Page}. + * @return + */ + static public Page page(String name) { + return new Page(name); + } + + /** + * Static constructor for {@link Folder}. + * @return + */ + static public Folder folder( Page ...pages ) { + return new Folder(pages); + } + + /** + * Static constructor for {@link Folder}. + * @return + */ + static public Folder folder( String name, Page ...pages ) { + return new Folder(name, pages); + } + + /** + * Static constructor for {@link VSash}. + * @return + */ + static public VSash vSash( String name, PanelTerm up, PanelTerm down) { + return new VSash(name, up, down); + } + + /** + * Static constructor for {@link VSash}. + * @return + */ + static public VSash vSash( PanelTerm up, PanelTerm down) { + return new VSash(up, down); + } + + /** + * Static constructor for {@link HSash}. + * @return + */ + static public HSash hSash( String name, PanelTerm left, PanelTerm right) { + return new HSash(name, left, right); + } + + /** + * Static constructor for {@link HSash}. + * @return + */ + static public HSash hSash( PanelTerm left, PanelTerm right) { + return new HSash(left, right); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/VSash.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/VSash.java new file mode 100644 index 00000000000..8cb6c405cc0 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/VSash.java @@ -0,0 +1,66 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + + +/** + * Class for structure representing vertical sash in Checker + * + * @author dumoulin + * + */ +public class VSash extends AbstractSash { + + /** + * Constructor. + * + * @param leftup + * @param rightdown + */ + public VSash(PanelTerm left, PanelTerm right) { + super(left, right); + } + + /** + * Constructor. + * + * @param leftup + * @param rightdown + */ + public VSash(String name, PanelTerm left, PanelTerm right) { + super(name, left, right); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.IModelObject.sashmodel.query.IQueryTerm#accept(IPagesModelVisitor, EObject) + * + * @param visitor + * @throws PagesModelException + */ + public void accept(IPagesModelVisitor visitor, M modelObject) throws PagesModelException { + visitor.walk(this, modelObject); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.di.sashmodel.query.AbstractSash#getStringName() + * + * @return + */ + @Override + protected String getStringName() { + return "VSash"; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/WindowTerm.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/WindowTerm.java new file mode 100644 index 00000000000..2d4d09a4b70 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/WindowTerm.java @@ -0,0 +1,83 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; + + +/** + * A term representing a Window in the query + * + * @author cedric dumoulin + * + */ +public class WindowTerm implements IModelExp { + + /** + * A window have only one panel. + */ + protected PanelTerm panel; + + protected String name; + + /** + * Constructor. + * + * @param panel + */ + public WindowTerm(PanelTerm panel) { + this.panel = panel; + } + + /** + * Constructor. + * + * @param name + * @param panel + */ + public WindowTerm(String name, PanelTerm panel) { + this.name = name; + this.panel = panel; + } + + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.IModelObject.sashmodel.query.IQueryTerm#accept(org.eclipse.papyrus.infra.core.sasheditor.IPagesModelVisitor.sashmodel.query.IQueryVisitor, org.eclipse.emf.ecore.EObject) + * + * @param visitor + * @param panel + * @throws PagesModelException + */ + public void accept(IPagesModelVisitor visitor, M windowModel) throws PagesModelException { + + visitor.walk(this, windowModel); + + } + + + /** + * @return the panel + */ + public PanelTerm getPanel() { + return panel; + } + + + /** + * @return the name + */ + public String getName() { + return name; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/package-info.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/package-info.java new file mode 100644 index 00000000000..331140c54c3 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/pagesmodel/package-info.java @@ -0,0 +1,19 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +/** + * @author cedric dumoulin + * + */ +package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel; \ No newline at end of file diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/AllTests.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/AllTests.java new file mode 100644 index 00000000000..390f62aa3c6 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/AllTests.java @@ -0,0 +1,32 @@ +/***************************************************************************** + * Copyright (c) 2010 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 + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.tests; + +import org.junit.runner.RunWith; +import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; +import org.junit.runners.Suite.SuiteClasses; + + +/** + * All tests for this plugin + */ +@RunWith(ClassificationSuite.class) +@SuiteClasses({ +// testModel1 +org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.AllTests.class, +org.eclipse.papyrus.infra.core.sasheditor.editor.AllTests.class, +org.eclipse.papyrus.infra.core.sasheditor.internal.AllTests.class, +org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.AllTests.class +}) +public class AllTests { + //Testsuite +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/AllTests.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/AllTests.java new file mode 100644 index 00000000000..7e180942bd2 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/AllTests.java @@ -0,0 +1,33 @@ +/***************************************************************************** + * Copyright (c) 2012 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor; + +import org.junit.runner.RunWith; +import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; +import org.junit.runners.Suite.SuiteClasses; + + +/** + * @author cedric dumoulin + * + */ +@RunWith(ClassificationSuite.class) +@SuiteClasses({ FakeEditorInputTest.class, + FakeMultiSashPageEditorTest.class + }) + +public class AllTests { + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInput.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInput.java new file mode 100644 index 00000000000..6f3d734817c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInput.java @@ -0,0 +1,114 @@ +package org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IPersistableElement; +import org.eclipse.ui.part.FileEditorInput; + +/** + * A fake {@link IEditorInput} suitable for creating TextEditor. + * This IEditorInput allows to carry the {@link ISashWindowsContentProvider} to the created Editor. + * + * + * @copy Copied from org.eclipse.ui.internal.part.NullEditorInput v3.8 + */ +public class FakeEditorInput extends FileEditorInput implements IEditorInput { + + protected ISashWindowsContentProvider contentProvider; + + static int count =0; + + /** + * Create a temporary file to pass to the texteditor. + * @return + */ + static IFile createIFile() { + // the name used is no important as nothing is created. + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.tests.tmp"); + IFile model1File = p.getFile("tmp/model" + count++ +".txt"); +// System.err.println("file: " + model1File.getName()); + return model1File; + } + + /** + * Creates a FakeEditorInput. + */ + public FakeEditorInput() { + super(createIFile()); + } + + /** + * Constructor. + * Carry the contentProvider to the created editor. + * + * @param contentProvider + */ + public FakeEditorInput(ISashWindowsContentProvider contentProvider) { + super(createIFile()); + this.contentProvider = contentProvider; + } + + /** + * + * @return + */ + public ISashWindowsContentProvider getContentProvider() { + return contentProvider; + } + + /** + * + * @param contentProvider + */ + public void setContentProvider(ISashWindowsContentProvider contentProvider) { + this.contentProvider = contentProvider; + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IEditorInput#exists() + */ + public boolean exists() { + return false; + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IEditorInput#getImageDescriptor() + */ + public ImageDescriptor getImageDescriptor() { + return ImageDescriptor.getMissingImageDescriptor(); + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IEditorInput#getName() + */ +// public String getName() { +// String result = null; +// return ""; //$NON-NLS-1$ +// } + + /* (non-Javadoc) + * @see org.eclipse.ui.IEditorInput#getPersistable() + */ + public IPersistableElement getPersistable() { + return null; + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IEditorInput#getToolTipText() + */ + public String getToolTipText() { + return ""; //$NON-NLS-1$ + } + + /* (non-Javadoc) + * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) + */ + public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) { + return null; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInputTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInputTest.java new file mode 100644 index 00000000000..8455cda5db6 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeEditorInputTest.java @@ -0,0 +1,46 @@ +/***************************************************************************** + * Copyright (c) 2012 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; +import org.eclipse.ui.IEditorInput; +import org.junit.Assert; +import org.junit.Test; + + +/** + * @author dumoulin + * + */ +public class FakeEditorInputTest { + + /** + * Test method for {@link org.eclipse.ui.part.FileEditorInput#equals(java.lang.Object)}. + */ + @Test + //@Ignore + public void testEquals() { + + + ISashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + IEditorInput input1 = new FakeEditorInput(contentProvider); + + IEditorInput input2 = new FakeEditorInput(contentProvider); + + Assert.assertNotEquals("input are different", input1, input2); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditor.java new file mode 100644 index 00000000000..e5c082c219c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditor.java @@ -0,0 +1,386 @@ +/***************************************************************************** + * Copyright (c) 2009 CEA LIST & LIFL + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.editor.IMultiPageEditorPart; +import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer; +import org.eclipse.papyrus.infra.core.sasheditor.internal.IMultiEditorManager; +import org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer; +import org.eclipse.papyrus.infra.core.sasheditor.internal.eclipsecopy.MultiPageSelectionProvider; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.part.EditorPart; + +/** + * A fake editor used for JUnit tests. + * + * This main editor provide the minimum required to let a {@link SashWindowsContainer} run inside. + * It allows addition of pages (editor and components). + * To create an instance of this editor, use one of the {@link #openEditor()} method. It is possible to provide + * a {@link ISashWindowsContentProvider} fully initialized. + * See {@link FakeMultiSashPageEditorTest} for code examples. + * + * For tests to run properly, the editor should be registered as eclipse extension: + * + *
+ * {@code
+ *     
+ *       
+ *       
+ *    
+ *  }
+ * 
+ * + * @author Cedric Dumoulin + */ +public class FakeMultiSashPageEditor extends EditorPart implements IMultiEditorManager, IMultiPageEditorPart { + + /** + * Id used to register this editor in Eclipse. + * Can be used to open the editor. + */ + public static String EditorID = "org.eclipse.papyrus.infra.core.sasheditor.tests.editor.FakeMultiSashPageEditor"; + + /** The pageProvider */ + private ISashWindowsContentProvider pageProvider; + + /** The sash windows system :-) */ + private SashWindowsContainer sashContainer; + + /** + * IEditorPart of the opened editor. + */ + protected IEditorPart mainEditorPart; + + + /** + * Return an instance of the editor inside the Eclipse framework. + * The Editor should be registered to Eclipse extension. + * The editor will be created with the specified number of nested editors of type {@link TestTextEditor} + * + * @param nestedEditorCount + * Number of expected nested editors. + * + * @throws PartInitException + */ + public static FakeMultiSashPageEditor openEditor(int nestedEditorCount) throws PartInitException { + // Create a content provider with one editor + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + // Create pages and add them to the default folder + for(int i = 0; i < nestedEditorCount; i++) { + IPageModel newModel = new TextEditorPartModel("editor" + i); + contentProvider.addPage(newModel); + } + + return openEditor(contentProvider); + } + + /** + * Return an instance of the editor inside the Eclipse framework. + * The Editor should be registered to Eclipse extension. + * The editor will contain one nested editor. + * + * @throws PartInitException + */ + public static FakeMultiSashPageEditor openEditor() throws PartInitException { + + return openEditor(1); + } + + private static class OpenEditorRunnable implements Runnable { + + private ISashWindowsContentProvider contentProvider; + + private FakeMultiSashPageEditor editor; + + public OpenEditorRunnable(ISashWindowsContentProvider contentProvider) { + this.contentProvider = contentProvider; + } + + public void run() { + IEditorInput input = new FakeEditorInput(contentProvider); + + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + IWorkbenchPage page = window.getActivePage(); + try { + IEditorPart part = page.openEditor(input, FakeMultiSashPageEditor.EditorID); + + this.editor = (FakeMultiSashPageEditor)part; + } catch (PartInitException ex) { + ex.printStackTrace(System.out); + } + } + + public FakeMultiSashPageEditor getEditor() { + return editor; + } + } + + /** + * Return an instance of the editor inside the Eclipse framework. + * The Editor should be registered to Eclipse extension. + * + * @throws PartInitException + */ + public static FakeMultiSashPageEditor openEditor(ISashWindowsContentProvider contentProvider) throws PartInitException { + OpenEditorRunnable runnable = new OpenEditorRunnable(contentProvider); + Display.getDefault().syncExec(runnable); + return runnable.getEditor(); + } + + /** + * Close the specified editor. + * + * @param editor + */ + public static void closeEditor(final FakeMultiSashPageEditor editor) { + Display.getDefault().syncExec(new Runnable() { + + public void run() { + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + IWorkbenchPage page = window.getActivePage(); + page.closeEditor(editor, false); + } + }); + } + + /** + * get the contentProvider. Create it if necessary. + * + * @return + */ + public ISashWindowsContentProvider getContentProvider() { + + return getContentProviderImpl(); + } + + /** + * get the contentProvider. Create it if necessary. + * This return the internal implementation. + * Misc method. If the internal impl is not of the specified type, throw an exception ... + * + * @return + */ + public SimpleSashWindowsContentProvider getContentProviderImpl() { + if(pageProvider == null) { + pageProvider = createPageProvider(); + } + + return (SimpleSashWindowsContentProvider)pageProvider; + } + + /** + * Set the contentProvider if not set. If it is already set, this method do not change it. + * + * @param contentProvider + */ + public void setContentProvider(ISashWindowsContentProvider contentProvider) { + if(pageProvider == null) { + pageProvider = contentProvider; + } + } + + /** + * Create and initialize the pageProvider. + */ + protected ISashWindowsContentProvider createPageProvider() { + ISashWindowsContentProvider pageProvider = new SimpleSashWindowsContentProvider(); + // Adding requested pages + pageProvider.addPage(new TextEditorPartModel()); + + return pageProvider; + } + + /** + * Handles a property change notification from a nested editor. The default implementation simply forwards the change to + * listeners on this multi-page editor by calling firePropertyChange with the same property id. For example, if + * the dirty state of a nested editor changes (property id IEditorPart.PROP_DIRTY), this method handles it + * by firing a property change event for IEditorPart.PROP_DIRTY to property listeners on this multi-page + * editor. + *

+ * Subclasses may extend or reimplement this method. + *

+ * + * @copiedfrom org.eclipse.ui.part.MultiPageEditorPart.handlePropertyChange(int) + * + * @param propertyId + * the id of the property that changed + */ + // protected void handlePropertyChange(int propertyId) { + // firePropertyChange(propertyId); + // } + + /** + * The MultiPageEditorPart implementation of this IEditorPart method sets its site to the given + * site, its input to the given input, and the site's selection provider to a MultiPageSelectionProvider. + * Subclasses may extend this method. + * + * @copiedfrom org.eclipse.ui.part.MultiPageEditorPart + * @param site + * The site for which this part is being created; must not be null. + * @param input + * The input on which this editor should be created; must not be null. + * @throws PartInitException + * If the initialization of the part fails -- currently never. + */ + @Override + public void init(IEditorSite site, IEditorInput input) throws PartInitException { + + // Check if the input carry a ContentProvider. + if(input instanceof FakeEditorInput) { + // Get the content provider from the input + FakeEditorInput providerInput = (FakeEditorInput)input; + ISashWindowsContentProvider provider = providerInput.getContentProvider(); + if(provider != null) { + setContentProvider(provider); + } + } + + setSite(site); + setInput(input); + site.setSelectionProvider(new MultiPageSelectionProvider(this)); + } + + /** + * Create the part controls. {@inheritDoc} + */ + @Override + public void createPartControl(Composite parent) { + + // Create and intialize sash windows + sashContainer = new SashWindowsContainer(this); + sashContainer.setContentProvider(getContentProvider()); + sashContainer.createPartControl(parent); + activate(); + } + + /** + * Method to activate the editor. + * Called immediately after createPartControl() is complete. + * To be implemented by subclasses. Default implementation do nothing. + */ + protected void activate() { + } + + /** + * Method to deactivate the editor. + * Called when dispose() is called. + * To be implemented by subclasses. Default implementation do nothing. + */ + protected void deactivate() { + } + + /** + * Dispose the Editor. Also dispose the sashsystem. + * + * @see org.eclipse.ui.part.WorkbenchPart#dispose() + * + */ + @Override + public void dispose() { + deactivate(); + super.dispose(); + // System.err.println("editor disposed"); + // Clean references + mainEditorPart = null; + pageProvider = null; + sashContainer = null; + } + + /** + * Refresh the sash windows system + */ + public void refreshTabs() { + if(sashContainer != null) { + sashContainer.refreshTabs(); + } + + } + + + /** + * Needed by MultiPageActionBarContributor and MultiPageSelectionProvider. + */ + public IEditorPart getActiveEditor() { + return sashContainer.getActiveEditor(); + } + + /** + * Get the {@link ISashWindowsContainer}. + * Note the the ISashWindowsContainer can also be acuired with getAdapter(ISashWindowsContainer.class). + */ + public ISashWindowsContainer getISashWindowsContainer() { + return sashContainer; + } + + /** + * Get the {@link ISashWindowsContainer}. + * Note the the ISashWindowsContainer can also be acuired with getAdapter(ISashWindowsContainer.class). + */ + public SashWindowsContainer getSashWindowsContainer() { + return sashContainer; + } + + /** + * + * {@inheritDoc} + */ + @Override + public void setFocus() { + sashContainer.setFocus(); + + } + + /** + * (non-Javadoc) + * Method declared on IEditorPart. + */ + @Override + public boolean isSaveAsAllowed() { + return false; + } + + @Override + public void doSave(IProgressMonitor monitor) { + + } + + @Override + public void doSaveAs() { + + } + + @Override + public boolean isDirty() { + return false; + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditorTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditorTest.java new file mode 100644 index 00000000000..1faff1a1208 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/FakeMultiSashPageEditorTest.java @@ -0,0 +1,252 @@ +/***************************************************************************** + * Copyright (c) 2012 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.simple.SimpleSashWindowsContentProvider; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.junit.After; +import org.junit.Test; + + +/** + * Tests for testing the {@link FakeMultiSashPageEditor} test editor. + * + * @author Cedric dumoulin + * + */ +public class FakeMultiSashPageEditorTest /* extends AbstractPapyrusTest */{ + + /** + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + Display.getDefault().syncExec(new Runnable() { + + public void run() { + // Close all remaining opened editors + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + IWorkbenchPage page = window.getActivePage(); + page.closeAllEditors(false); + } + }); + } + + /** + * Test openEditor with a provided provider. + * + * @throws Exception + */ + @Test + public void testOpenEditor_contentProvider() throws Exception { + + // Create a content provider + SimpleSashWindowsContentProvider contentProvider = new SimpleSashWindowsContentProvider(); + + // Create pages and add them to the default folder + List models = new ArrayList(); + for(int i = 0; i < 3; i++) { + IPageModel newModel = new TextEditorPartModel("model" + i); + contentProvider.addPage(newModel); + models.add(newModel); + } + + FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(contentProvider); + + assertNotNull("Editor is created", editor); + assertSame("ContentProvider is set", contentProvider, editor.getContentProvider()); + + // Check nested editor types + IEditorPart nestedEditor = editor.getActiveEditor(); + assertTrue("nested editor is of right type", (nestedEditor instanceof TestTextEditor)); + + FakeMultiSashPageEditor.closeEditor(editor); + } + + /** + * Test openEditor with a provided provider. + * + * @throws Exception + */ + @Test + public void testOpenEditor() throws Exception { + + FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(); + + assertNotNull("Editor is created", editor); + assertNotNull("ContentProvider is set", editor.getContentProvider()); + IEditorPart activeEditor = editor.getActiveEditor(); + assertNotNull("Active editor set", activeEditor); + + // Check nested editor types + IEditorPart nestedEditor = editor.getActiveEditor(); + assertEquals("nested editor is of right type", TestTextEditor.class, nestedEditor.getClass()); + + FakeMultiSashPageEditor.closeEditor(editor); + } + + /** + * Test openEditor with a provided provider. + * + * @throws Exception + */ + @Test + public void testOpenEditor_nestedEditorCount() throws Exception { + + int nestedEditorCount = 4; + + FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(nestedEditorCount); + + assertNotNull("Editor is created", editor); + assertNotNull("ContentProvider is set", editor.getContentProvider()); + IEditorPart activeEditor = editor.getActiveEditor(); + assertNotNull("Active editor set", activeEditor); + + // Check nested editor types + IEditorPart nestedEditor = editor.getActiveEditor(); + assertEquals("nested editor is of right type", TestTextEditor.class, nestedEditor.getClass()); + + FakeMultiSashPageEditor.closeEditor(editor); + } + + /** + * Test openEditor with a provided provider. + * + * @throws Exception + */ + @Test + public void testCloseEditor() throws Exception { + + FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(); + + assertNotNull("Editor is created", editor); + assertNotNull("ContentProvider is set", editor.getContentProvider()); + IEditorPart activeEditor = editor.getActiveEditor(); + assertNotNull("Active editor set", activeEditor); + + // Check nested editor types + IEditorPart nestedEditor = editor.getActiveEditor(); + assertEquals("nested editor is of right type", TestTextEditor.class, nestedEditor.getClass()); + + FakeMultiSashPageEditor.closeEditor(editor); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor.FakeMultiSashPageEditor#getActiveEditor()}. + * + * @throws PartInitException + */ + @Test + public void testGetSashContainer() throws PartInitException { + FakeMultiSashPageEditor editor = FakeMultiSashPageEditor.openEditor(); + + assertNotNull("Container is set", editor.getSashWindowsContainer()); + + FakeMultiSashPageEditor.closeEditor(editor); + } + + /** + * Check if we can start several {@link FakeMultiSashPageEditor} in the same time + * + * @throws PartInitException + */ + @Test + public void testStartMultipleFakeEditors() throws PartInitException { + + + FakeMultiSashPageEditor editor1 = FakeMultiSashPageEditor.openEditor(2); + FakeMultiSashPageEditor editor2 = FakeMultiSashPageEditor.openEditor(2); + FakeMultiSashPageEditor editor3 = FakeMultiSashPageEditor.openEditor(2); + + assertNotSame("got different editors", editor1, editor2); + assertNotSame("got different editors", editor1, editor3); + assertNotSame("got different editors", editor2, editor3); + + FakeMultiSashPageEditor.closeEditor(editor1); + FakeMultiSashPageEditor.closeEditor(editor2); + FakeMultiSashPageEditor.closeEditor(editor3); + + } + + /** + * Check if we can start several {@link FakeMultiSashPageEditor} in the same time + * + * @throws PartInitException + */ + @Test + public void testStartMultipleFakeEditorsOneByOne() throws PartInitException { + + + FakeMultiSashPageEditor editor1 = FakeMultiSashPageEditor.openEditor(); + FakeMultiSashPageEditor.closeEditor(editor1); + + FakeMultiSashPageEditor editor2 = FakeMultiSashPageEditor.openEditor(); + assertNotSame("got different editors", editor1, editor2); + FakeMultiSashPageEditor.closeEditor(editor2); + + + FakeMultiSashPageEditor editor3 = FakeMultiSashPageEditor.openEditor(); + + assertNotSame("got different editors", editor1, editor3); + assertNotSame("got different editors", editor2, editor3); + + FakeMultiSashPageEditor.closeEditor(editor3); + } + + /** + * Check if we can start several {@link FakeMultiSashPageEditor} in the same time. Here + * editors are closed by calling editor.dispose(). + * This test succeed, but exception are outputted because the dispose() on editor doesn't + * fried the editors from workbench. + * + * @throws PartInitException + */ + @Test + //@Ignore + public void testStartMultipleFakeEditorsOneByOneAndDispose() throws PartInitException { + + + FakeMultiSashPageEditor editor1 = FakeMultiSashPageEditor.openEditor(); + editor1.dispose(); + + FakeMultiSashPageEditor editor2 = FakeMultiSashPageEditor.openEditor(); + assertNotSame("got different editors", editor1, editor2); + editor2.dispose(); + + + FakeMultiSashPageEditor editor3 = FakeMultiSashPageEditor.openEditor(); + + assertNotSame("got different editors", editor1, editor3); + assertNotSame("got different editors", editor2, editor3); + + editor3.dispose(); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TestTextEditor.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TestTextEditor.java new file mode 100644 index 00000000000..7511e61e64a --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TestTextEditor.java @@ -0,0 +1,128 @@ +/***************************************************************************** + * Copyright (c) 2009 CEA LIST & LIFL + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor; + +import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords; +import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceLogger; +import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecordsFactory; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.editors.text.TextEditor; + + +/** + * A TextEditor that can be used as Tab of a sashes window. + * + * @author dumoulin + */ +public class TestTextEditor extends TextEditor { + + private TraceLogger traceLog; + /** + * Id used to register this editor in Eclipse. + * Can be used to open the editor. + */ + public static String EditorID = "org.eclipse.papyrus.infra.core.sasheditor.tests.editor.TestTextEditor"; + + /** + * + */ + public TestTextEditor() { + this("", false); + } + + /** + * + * Constructor. + * + * @param namespace Namespace used to associated traces + * @param traceRecords Records where traces should be put. + */ + public TestTextEditor(String name, ITraceRecords traceRecords) { + this.traceLog = new TraceLogger(name, traceRecords); + } + + /** + * + * Constructor. + * + * @param namespace Namespace used to associated traces + * @param isRecording true is the traceRecord should record. + */ + public TestTextEditor(String name, boolean isRecording) { + this(name, TraceRecordsFactory.createTraceRecords(isRecording)); + } + + + /** + * @return the traceLog + */ + public TraceLogger getTraceLog() { + return traceLog; + } + + /** + * Set the namespace of this part. {@inheritDoc} + */ + @Override + public void setPartName(String partName) { + super.setPartName(partName); + } + + /** + * Trace the call + * @see org.eclipse.ui.editors.text.TextEditor#dispose() + * + */ + @Override + public void dispose() { + // Trace the call + traceLog.trace("dispose"); + + super.dispose(); + } + + /** + * Close the specified editor. + * @param editor + */ + public static void closeEditor( TestTextEditor editor ) { + IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + IWorkbenchPage page = window.getActivePage(); + page.closeEditor(editor, false); + } + + /** + * Return an instance of the editor inside the Eclipse framework. + * The Editor should be registered to Eclipse extension. + * The editor will contain one nested editor. + * @throws PartInitException + */ + public static TestTextEditor openEditor() throws PartInitException { + + IEditorInput input = new FakeEditorInput(); + + IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + IWorkbenchPage page = window.getActivePage(); + IEditorPart part = page.openEditor(input, EditorID); + + return (TestTextEditor)part; + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TextEditorPartModel.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TextEditorPartModel.java new file mode 100644 index 00000000000..d239beb0dd8 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/texteditor/TextEditorPartModel.java @@ -0,0 +1,129 @@ +/***************************************************************************** + * Copyright (c) 2009, 2014 LIFL, 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: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * Christian W. Damus (CEA) - bug 392301 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.sasheditor.tests.texteditor; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel; +import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords; +import org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecordsFactory; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.part.EditorActionBarContributor; + +/** + * Description of the first page + * + * @author dumoulin + */ + +public class TextEditorPartModel implements IEditorModel { + + /** + * Records used to record traces. + */ + private ITraceRecords traceRecords; + + private String title; + + + static private int count = 0; + + /** + * @param title + */ + public TextEditorPartModel(String title) { + this( title, false); + } + + /** + * @param title + */ + public TextEditorPartModel(String title, boolean isRecording) { + this(title, TraceRecordsFactory.createTraceRecords(isRecording)); + + } + + /** + * + */ + public TextEditorPartModel() { + this( null, false); + } + + /** + * @param title + */ + public TextEditorPartModel(String title, ITraceRecords traceRecords) { + this.title = title; + if( title == null) + this.title = "newText" + count++; + + this.traceRecords = traceRecords; + } + + + /** + * @return the traceRecords + */ + public ITraceRecords getTraceRecords() { + return traceRecords; + } + + + /** + * @param traceRecords the traceRecords to set + */ + public void setTraceRecords(ITraceRecords traceRecords) { + this.traceRecords = traceRecords; + } + + public IEditorPart createIEditorPart() throws PartInitException { + + // Create an editor with the requested traceRecords + TestTextEditor editor = new TestTextEditor(title, traceRecords); + + editor.setPartName(title); + + return editor; + } + + public Image getTabIcon() { + return null; + } + + public String getTabTitle() { + return title; + } + + /** + * Return this. In this implementation, the rawModel and the IEditorModel are the same. + * + */ + public Object getRawModel() { + return this; + } + + /** + * Return the ActionBarContributor dedicated to the created editor. + * Can return null if no particular ActionBarContributor is required.; + */ + public EditorActionBarContributor getActionBarContributor() { + return null; + } + + public void dispose() { + // Pass + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/ISashWindowsContentProviderTestUtils.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/ISashWindowsContentProviderTestUtils.java new file mode 100644 index 00000000000..bd8d398a533 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/ISashWindowsContentProviderTestUtils.java @@ -0,0 +1,78 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.tests.utils; + +import java.util.Map; + +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.IModelExp; +import org.eclipse.papyrus.infra.core.sasheditor.pagesmodel.PagesModelException; + + +/** + * Common interface for utilities dedicated to IContentProvider tests. Implementations of this class + * allow to create an internal model according to a provided {@link IModelExp}. It is also possible + * to check if the internal model is conform to the {@link IModelExp}. + * + *
+ * There is several {@link ISashWindowsContentProvider} implementations, but a lot of tests are commons to + * all the implementations. The interface allows to develop common tests regardless of the real implementation. + *
+ * One develop common tests using {@link ISashWindowsContentProvider} and {@link IContentProviderTestUtils}. Then, + * this test is subclassed and the appropriate implementations are specified in the subclasses. + * + * + * @author cedric dumoulin + * + */ +public interface ISashWindowsContentProviderTestUtils { + + /** + * Create an internal model conform to the specified query. + * Any previous model is disguarded. + * + * Some implementations do not allow to call this method more than once. In this case, + * the implementation should throw an Exception. + * + * @param query Should be a subtype PanelTerm (Folder, HSash, VSash) + * @throws QueryException + * + */ + public abstract void createModel(IModelExp query) throws PagesModelException; + + /** + * Check if the internal model is conformed to the specified query. + * @param query + * @throws QueryException + */ + public abstract void assertConform(IModelExp query) throws PagesModelException; + + /** + * Get element in the model. + * Each model element whose corresponding model query part as a name is added to the result map. + * The element is then accessible with the name set in the query part. + * + * @param query + * @return + * @throws QueryException + */ + public abstract Map queryModel(IModelExp query) throws PagesModelException; + + /** + * Get the {@link ISashWindowsContentProvider} associated to this utility class. + * @return + */ + public ISashWindowsContentProvider getIContentProvider(); +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/LeakingObject.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/LeakingObject.java new file mode 100644 index 00000000000..d8f8d0da184 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/LeakingObject.java @@ -0,0 +1,19 @@ +package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak; + +import java.util.HashMap; +import java.util.Map; + +/** + * For testing purpose + * @copyright http://www.forkcan.com/viewcode/215/Detecting-memory-leak-in-unit-test + * + */ +public class LeakingObject { + + static Map leakingMap = new HashMap(); + + public LeakingObject() { + leakingMap.put(this, System.currentTimeMillis()); + } + +} \ No newline at end of file diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakTest.java new file mode 100644 index 00000000000..ba36e8a3dd0 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakTest.java @@ -0,0 +1,79 @@ +package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak; +import static org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak.MemoryLeakUtil.assertIsGarbageCollected; +import static org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak.MemoryLeakUtil.assertIsGarbageCollected2; + +import java.lang.ref.WeakReference; + +import org.junit.Test; + + +/** + * Test the memory ling assertions. + * + * @copyright http://www.forkcan.com/viewcode/215/Detecting-memory-leak-in-unit-test + * + */ +public class MemoryLeakTest { + + /* This test of the LeakingObject will fail */ + @Test + public void testLeakingObject() { + LeakingObject lo = new LeakingObject(); + + // 1. Create WeakReference for the object + WeakReference loWeakRef = new WeakReference(lo); + + // 2. Remove strong reference for the object + lo = null; + + // 3. Test object is garbage collected correctly + assertIsGarbageCollected(loWeakRef, 10*1000); + } + + /* This test of the NonLeakingObject will succeed */ + @Test + public void testNonLeakingObject() { + NonLeakingObject lo = new NonLeakingObject(); + + // 1. Create WeakReference for the object + WeakReference loWeakRef = new WeakReference(lo); + + // 2. Remove strong reference for the object + lo = null; + + // 3. Test object is garbage collected correctly + assertIsGarbageCollected(loWeakRef, 10*1000); + } + +/* This test of the LeakingObject will fail */ + @Test + public void testLeakingObject2() { + LeakingObject lo = new LeakingObject(); + + // 1. Create WeakReference for the object + WeakReference loWeakRef = new WeakReference(lo); + + // 2. Remove strong reference for the object + lo = null; + + // 3. Test object is garbage collected correctly + assertIsGarbageCollected2(loWeakRef, 10*1000); + } + +/* This test of the NonLeakingObject will succeed */ + @Test + public void testNonLeakingObject2() { + NonLeakingObject lo = new NonLeakingObject(); + + // 1. Create WeakReference for the object + WeakReference loWeakRef = new WeakReference(lo); + + // 2. Remove strong reference for the object + lo = null; + + // 3. Test object is garbage collected correctly + assertIsGarbageCollected2(loWeakRef, 10*1000); + } + + +} \ No newline at end of file diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakUtil.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakUtil.java new file mode 100644 index 00000000000..45c93e3f4ce --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/MemoryLeakUtil.java @@ -0,0 +1,201 @@ +/***************************************************************************** + * Copyright (c) 2012 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak; + +import static org.junit.Assert.fail; + +import java.lang.ref.PhantomReference; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; + +/** + * Provides an assertion method to verify that an object has been garbage collected. + * + * This method forward to one of the two implementations: + *
+ * {@link #assertIsGarbageCollected0(WeakReference, long)} + *
+ * {@link #assertIsGarbageCollected2(WeakReference, long)} + * + */ +public class MemoryLeakUtil { + + private static final int MAX_GC_ITERATIONS = 20; + private static final int GC_SLEEP_TIME = 100; + + public static void assertIsGarbageCollected(WeakReference ref, long timeout) { + // Slower method +// assertIsGarbageCollected0(ref, timeout); + // Faster method + assertIsGarbageCollected2(ref, timeout); + } + + /** + * Check that the specified Object (referenced through a WeakReference) is garbage collected + * in the designated time. Otherwise throw an assertion failure. + *

+ * IMPORTANT : in order for this method to work properly and success, you must get rid of all + * strong references of your object in the method callee. For example : + *

+   *  MyObject myObj = new MyObject();
+   *  // myObj.work();
+   *  // myObj.close();
+   *  
+   *  // 1. Create WeakReference for the object
+   *  WeakReference objWeakRef = new WeakReference(pub1); 
+   *  // 2. Remove strong reference for the object
+   *  myObj = null;  
+   *  // 3. Test object is garbage collected correctly, leaving 10 seconds for the test to succeed
+   *  assertObjectIsGarbageCollected(objWeakRef, 10*1000);
+   * 
+ *

+ * Implementation note : this method will trigger a GC through + * System.gc() every second until the timeout has been + * reached or the object is detected has garbage collected. + * + * @param wRef the object WeakReference (required to prevent strong reference of object through callstack) + * @param timeout the timeout after which this method will consider (should be a multiple of 1000 ms with current implementation) + * @throws Exception + */ + public static void assertIsGarbageCollected0(WeakReference ref, long timeout) { + + // already cleared ? + if( ref.get() == null) + return; + + for (int i = 0; i < MAX_GC_ITERATIONS; i++) { + s_runtime.runFinalization(); +// System.err.println("Try to garbage iter " + i); + try { + runGC(); + } catch (Exception e1) { + e1.printStackTrace(); + } + + if (ref.get() == null) + return ; + + // Pause for a while and then go back around the loop to try again... + try { + Thread.sleep(GC_SLEEP_TIME); + } catch (InterruptedException e) { + // Ignore any interrupts and just try again... + } + } + + fail("Object '" + ref.get() + "' was not be garbage collected "); + + } + + /** + * Check that the specified Object (referenced through a WeakReference) is garbage collected + * in the designated time. Otherwise throw an assertion failure. + *

+ * IMPORTANT : in order for this method to work properly and success, you must get rid of all + * strong references of your object in the method callee. For example : + *

+   *  MyObject myObj = new MyObject();
+   *  // myObj.work();
+   *  // myObj.close();
+   *  
+   *  // 1. Create WeakReference for the object
+   *  WeakReference objWeakRef = new WeakReference(pub1); 
+   *  // 2. Remove strong reference for the object
+   *  myObj = null;  
+   *  // 3. Test object is garbage collected correctly, leaving 10 seconds for the test to succeed
+   *  assertObjectIsGarbageCollected(objWeakRef, 10*1000);
+   * 
+ *

+ * Implementation note : this method will trigger a GC through + * System.gc() every second until the timeout has been + * reached or the object is detected has garbage collected. + * + * @param wRef the object WeakReference (required to prevent strong reference of object through callstack) + * @param timeout the timeout after which this method will consider (should be a multiple of 1000 ms with current implementation) + */ + public static void assertIsGarbageCollected2(WeakReference wRef, long timeout) { + final long PERIOD = 1000; // Perform GC and check every second; + + final long startTime = System.currentTimeMillis(); + + // Create a reference queue + ReferenceQueue rq = new ReferenceQueue(); + + // Add some phantom reference object to the queue + // the pr variable is never read, but there nothing to do with it + @SuppressWarnings("unused") + PhantomReference pr = new PhantomReference(wRef.get(), rq); + + // Poll the queue until the Reference is returned or the timeout is reached. + // If a non null value is returned by poll, it will indicate that the original + // object has been garbage collected + Reference ref = rq.poll(); + while (ref == null) { + System.gc(); // Trigger GC to help a bit + try { Thread.sleep(PERIOD); } catch (InterruptedException ex) {} + ref = rq.poll(); + + // Exit loop if timeout has been reached + long now = System.currentTimeMillis(); + if ((now - startTime) > timeout) { + break; + } + } + + + + // If no PhantomReference was found after the specified timeout, the garbage collection was unsuccessful + if (ref == null) { + // But before declaring it as a failure, check the WeakRefence + // -> If the WeakReference has been removed, then the object is not strongly reachable + // anymore so it also mean it has been garbage collected + Object obj = wRef.get(); + if (obj == null) { + return; + } + + fail("Object '" + wRef.get() + "' was not be garbage collected during the timeout of " + timeout + " ms"); + } + } + + + private static void runGC () throws Exception + { + // It helps to call Runtime.gc() + // using several method calls: + for (int r = 0; r < 4; ++ r) _runGC (); + } + + private static void _runGC () throws Exception + { + long usedMem1 = usedMemory (), usedMem2 = Long.MAX_VALUE; + for (int i = 0; (usedMem1 < usedMem2) && (i < 500); ++ i) + { + s_runtime.runFinalization (); + s_runtime.gc (); + Thread.yield (); + + usedMem2 = usedMem1; + usedMem1 = usedMemory (); + } + } + private static long usedMemory () + { + return s_runtime.totalMemory () - s_runtime.freeMemory (); + } + + private static final Runtime s_runtime = Runtime.getRuntime (); +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/NonLeakingObject.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/NonLeakingObject.java new file mode 100644 index 00000000000..acc86cc4781 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/memoryleak/NonLeakingObject.java @@ -0,0 +1,20 @@ +package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.memoryleak; + +import java.util.Map; +import java.util.WeakHashMap; + + +/** + * For testing purpose + * @copyright http://www.forkcan.com/viewcode/215/Detecting-memory-leak-in-unit-test + * + */ +public class NonLeakingObject { + + static Map leakingMap = new WeakHashMap(); + + public NonLeakingObject() { + leakingMap.put(this, System.currentTimeMillis()); + } + +} \ No newline at end of file diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/package-info.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/package-info.java new file mode 100644 index 00000000000..97527149270 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/package-info.java @@ -0,0 +1,19 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +/** + * @author dumoulin + * + */ +package org.eclipse.papyrus.infra.core.sasheditor.tests.utils; \ No newline at end of file diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/ITraceRecords.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/ITraceRecords.java new file mode 100644 index 00000000000..329a6740114 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/ITraceRecords.java @@ -0,0 +1,87 @@ +package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; + +import java.util.List; + + + +public interface ITraceRecords { + + /** + * Record a new trace. + * @param trace + */ + public abstract void addTrace(String trace); + + /** + * Record a new trace. + * @param trace + */ + public abstract void addTrace(String name, String trace); + + /** + * Record a new trace. + * @param trace + */ + public abstract void addTrace(String name, String trace, Object value); + + /** + * Record a new trace. + * @param trace + */ + public abstract void addTrace(String name, String trace, Object... values); + + /** + * Return the namespace and the trace in one concatenated string ("namespace,trace"). + * @param i Index of the requested trace + * @return + */ + public abstract String getFullName(int i); + + /** + * Get the value + * @param i + * @return + */ + public abstract Object getValue(int i); + + /** + * Return true if the trace contains the specified events. + * @return + */ + public abstract boolean contains(String name, String trace); + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public abstract int indexOf(String name, String trace, Object value); + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public abstract int indexOfNamespaceTrace(String name, String trace); + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public abstract int indexOfTrace(String trace); + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public abstract int indexOfNamespace(String namespace); + + /** + * Reset the trace. + */ + public abstract void reset(); + + /** + * @return the traces + */ + public abstract List getTraces(); + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/MultiValuesTraceRecord.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/MultiValuesTraceRecord.java new file mode 100644 index 00000000000..5db2a324893 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/MultiValuesTraceRecord.java @@ -0,0 +1,73 @@ +/***************************************************************************** + * Copyright (c) 2012 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; + +import java.util.ArrayList; +import java.util.List; + + +/** + * @author dumoulin + * + */ +public class MultiValuesTraceRecord extends TraceRecord { + + public List values; + + + public MultiValuesTraceRecord(String namespace, String trace, Object ... values) { + super(namespace, trace); + + // Initialie collection + this.values = new ArrayList(values.length); + for( Object o : values ) + this.values.add(o); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecord#getValue() + * + * @return + */ + @Override + public Object getValue() { + if( values.size()>0) + return values.get(0); + + // No value set. + return null; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecord#getValues() + * + * @return + */ + @Override + public List getValues() { + return values; + } + + /** + * + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecord#clear() + * + */ + @Override + public void clear() { + super.clear(); + values.clear(); + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/NullTraceRecords.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/NullTraceRecords.java new file mode 100644 index 00000000000..e272c80db2b --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/NullTraceRecords.java @@ -0,0 +1,155 @@ +/***************************************************************************** + * Copyright (c) 2012 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; + +import java.util.List; + + +/** + * A {@link ITraceRecords} recording nothing. + * + * @author Cedric Dumoulin + * + */ +public class NullTraceRecords implements ITraceRecords { + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#addTrace(java.lang.String) + * + * @param trace + */ + public void addTrace(String trace) { + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#addTrace(java.lang.String, java.lang.String) + * + * @param name + * @param trace + */ + public void addTrace(String name, String trace) { + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#addTrace(java.lang.String, java.lang.String, java.lang.Object) + * + * @param name + * @param trace + * @param value + */ + public void addTrace(String name, String trace, Object value) { + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#addTrace(java.lang.String, java.lang.String, java.lang.Object[]) + * + * @param name + * @param trace + * @param values + */ + public void addTrace(String name, String trace, Object... values) { + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#getFullName(int) + * + * @param i + * @return + */ + public String getFullName(int i) { + return null; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#getValue(int) + * + * @param i + * @return + */ + public Object getValue(int i) { + throw new UnsupportedOperationException("Not available"); + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#contains(java.lang.String, java.lang.String) + * + * @param name + * @param trace + * @return + */ + public boolean contains(String name, String trace) { + return false; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#indexOf(java.lang.String, java.lang.String, java.lang.Object) + * + * @param name + * @param trace + * @param value + * @return + */ + public int indexOf(String name, String trace, Object value) { + return -1; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#indexOfNamespaceTrace(java.lang.String, java.lang.String) + * + * @param name + * @param trace + * @return + */ + public int indexOfNamespaceTrace(String name, String trace) { + return -1; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#indexOfTrace(java.lang.String) + * + * @param trace + * @return + */ + public int indexOfTrace(String trace) { + return -1; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#indexOfNamespace(java.lang.String) + * + * @param namespace + * @return + */ + public int indexOfNamespace(String namespace) { + return -1; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#reset() + * + */ + public void reset() { + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.ITraceRecords#getTraces() + * + * @return + */ + public List getTraces() { + throw new UnsupportedOperationException("Not available"); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/SimpleTraceRecord.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/SimpleTraceRecord.java new file mode 100644 index 00000000000..c1273c6e855 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/SimpleTraceRecord.java @@ -0,0 +1,73 @@ +/***************************************************************************** + * Copyright (c) 2012 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; + +import java.util.List; + + +/** + * This class represent one simple record, with only one associated value. + * @author Cedric Dumoulin + * + */ +public class SimpleTraceRecord extends TraceRecord { + + public Object value; + + /** + * Constructor. + * + * @param namespace + * @param trace + * @param value + */ + public SimpleTraceRecord(String namespace, String trace, Object value) { + super(namespace, trace); + this.value = value; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecord#getValue() + * + * @return + */ + @Override + public Object getValue() { + return value; + } + + /** + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecord#getValues() + * + * @return + */ + @Override + public List getValues() { + // TODO Return an List backuped by the single value. + throw new UnsupportedOperationException("Not yet implemented"); + } + + /** + * + * @see org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace.TraceRecord#clear() + * + */ + @Override + public void clear() { + // TODO Auto-generated method stub + super.clear(); + value = null; + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceLogger.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceLogger.java new file mode 100644 index 00000000000..d9b19aad6e8 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceLogger.java @@ -0,0 +1,115 @@ +/***************************************************************************** + * Copyright (c) 2012 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; + + +/** + * Instances of this class are used to log traces of a namespace. + * + * @author Cedric Dumoulin + * + */ +public class TraceLogger { + + /** + * The namespace used to tag records. + */ + protected String namespace; + + /** + * The records + */ + protected ITraceRecords records; + + /** + * Constructor. + * A logger logging nothing. + * + * @param namespace + */ + public TraceLogger(String namespace, boolean isRecording) { + this.namespace = namespace; + this.records = TraceRecordsFactory.createTraceRecords(isRecording); + } + + /** + * Constructor. + * + * @param namespace + * @param records + */ + public TraceLogger(String namespace, ITraceRecords records) { + this.namespace = namespace; + this.records = records; + } + + + /** + * @return the records + */ + public ITraceRecords getTraceRecords() { + return records; + } + + + /** + * @param records the records to set + */ + public void setTraceRecords(ITraceRecords records) { + this.records = records; + } + + + /** + * @return the namespace + */ + public String getNamespace() { + return namespace; + } + + + /** + * @param namespace the namespace to set + */ + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + /** + * Record a new trace. + * @param trace + */ + public void trace(String trace) { + records.addTrace(namespace, trace, (Object)null); + } + + /** + * Record a new trace. + * @param trace + */ + public void trace(String trace, Object value) { + records.addTrace( namespace, trace, value); + } + + /** + * Record a new trace. + * @param trace + */ + public void trace(String trace, Object ... values) { + records.addTrace( namespace, trace, values); + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecord.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecord.java new file mode 100644 index 00000000000..a82fd336ab2 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecord.java @@ -0,0 +1,121 @@ +/***************************************************************************** + * Copyright (c) 2012 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; + +import java.util.List; + + +/** + * This interface represent one record + * @author Cedric Dumoulin + * + */ +public abstract class TraceRecord { + + public String namespace; + public String trace; + + + /** + * Constructor. + * + * @param namespace + * @param trace + */ + public TraceRecord(String namespace, String trace) { + this.namespace = namespace; + this.trace = trace; + } + + /** + * Get the full name, i.e. : the namespace, name + * @return + */ + public String getFullName() { + return namespace + "," + trace; + } + + /** + * Get the first value associated to this record. + * @return + */ + public abstract Object getValue(); + + /** + * Get all values associated to this record + * @return + */ + public abstract List getValues(); + + /** + * Return true if this object's trace equal the provided values. + * + * @param trace + * @return + */ + public boolean isEqualsToTrace( String trace) { + + return (this.trace.equals(trace)) ; + } + + /** + * Return true if this object's namespace equal the provided values. + * + * @param namespace + * @return + */ + public boolean isEqualsToNameSpace( String namespace) { + + return this.namespace.equals(namespace) ; + } + + /** + * Return true if this object's namespace and trace equal the provided values. + * If a provided value is null, it is consider as a wildcard. + * + * @param namespace + * @param trace + * @return + */ + public boolean isEqualsTo( String namespace, String trace) { + + return (namespace != null ? namespace.equals(this.namespace) : true) + && (trace != null ? trace.equals(this.trace) : true) ; + } + + /** + * Return true if this object's namespace and trace equal the provided values. + * If a provided value is null, it is consider as a wildcard. + * + * @param namespace + * @param trace + * @return + */ + public boolean isEqualsTo( String namespace, String trace, Object value) { + + return (namespace != null ? namespace.equals(this.namespace) : true) + && (trace != null ? trace.equals(this.trace) : true) + && (value != null ? value.equals(getValue()) : true); + } + + /** + * Clear the record. It will not be used anymore. This is mainly to avoid memory leak. + */ + public void clear() { + namespace = null; + trace = null; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecords.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecords.java new file mode 100644 index 00000000000..2376e66a32d --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecords.java @@ -0,0 +1,162 @@ +/** + * + */ +package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; + +import java.util.ArrayList; +import java.util.List; + + +/** + * A list of trace records. + * + * @author cedric dumoulin + * + */ +public class TraceRecords implements ITraceRecords { + + public Listtraces = new ArrayList(); + + /** + * Record a new trace. + * @param trace + */ + public void addTrace(String trace) { + addTrace(null, trace, (Object)null); + } + + /** + * Record a new trace. + * @param trace + */ + public void addTrace(String name, String trace) { + addTrace(name, trace, (Object)null); + } + + /** + * Record a new trace. + * @param trace + */ + public void addTrace(String name, String trace, Object value) { + traces.add(new SimpleTraceRecord( name, trace, value)); + } + + /** + * Record a new trace. + * @param trace + */ + public void addTrace(String name, String trace, Object ... values) { + traces.add(new MultiValuesTraceRecord( name, trace, values)); + } + + /** + * Return the namespace and the trace in one concatenated string ("namespace,trace"). + * @param i Index of the requested trace + * @return + */ + public String getFullName(int i) { + return traces.get(i).getFullName(); + } + + /** + * Get the value + * @param i + * @return + */ + public Object getValue(int i) { + return traces.get(i).getValue(); + } + + /** + * Return true if the trace contains the specified events. + * @return + */ + public boolean contains( String name, String trace) { + + return indexOfNamespaceTrace(name, trace) >= 0; + } + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public int indexOf(String name, String trace, Object value) { + + for (int i = 0; i < traces.size(); i++) { + TraceRecord record = traces.get(i); + + if( record.isEqualsTo(name, trace, value) ) + return i; + } + + return -1; + } + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public int indexOfNamespaceTrace(String name, String trace) { + + for (int i = 0; i < traces.size(); i++) { + TraceRecord record = traces.get(i); + + if( record.isEqualsTo(name, trace) ) + return i; + } + + return -1; + } + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public int indexOfTrace(String trace) { + + for (int i = 0; i < traces.size(); i++) { + TraceRecord record = traces.get(i); + + if( record.isEqualsToTrace(trace) ) + return i; + } + + return -1; + } + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public int indexOfNamespace(String namespace) { + + for (int i = 0; i < traces.size(); i++) { + TraceRecord record = traces.get(i); + + if( record.isEqualsToNameSpace(namespace) ) + return i; + } + + return -1; + } + + /** + * Reset the trace. + */ + public void reset() { + for( TraceRecord record : traces) { + record.clear(); + } + traces.clear(); + } + + + /** + * @return the traces + */ + public List getTraces() { + return traces; + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecordsFactory.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecordsFactory.java new file mode 100644 index 00000000000..2b8b15a48b5 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/tests/utils/trace/TraceRecordsFactory.java @@ -0,0 +1,42 @@ +/***************************************************************************** + * Copyright (c) 2012 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.tests.utils.trace; + + +/** + * Factory to create TraceRecords. + * @author dumoulin + * + */ +public class TraceRecordsFactory { + + + /** + * Create a TraceRecords. + * + * @param isRecording true is the traceRecord should record. + * @return + */ + public static ITraceRecords createTraceRecords( boolean isRecording ) { + + if(isRecording) { + return new TraceRecords(); + } + else { + return new NullTraceRecords(); + } + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/FakeObservableListener.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/FakeObservableListener.java new file mode 100644 index 00000000000..e0950121658 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/FakeObservableListener.java @@ -0,0 +1,84 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.utils; + +import java.util.ArrayList; +import java.util.List; + + +/** + * A fake listener for testing purpose. + * + * @author cedric dumoulin + * + */ +public class FakeObservableListener implements IObservableListListener { + + /** + * Trace of event received + */ + protected List addEvents = new ArrayList(); + + /** + * Trace of event received + */ + protected List removeEvents = new ArrayList(); + + + /** + * @return the events + */ + public List getAddEvents() { + return addEvents; + } + + /** + * @return the events + */ + public E getLastAddEvents() { + if(addEvents.size()>0) { + return addEvents.get(addEvents.size() -1); + } + + return null; + } + + /** + * @return the events + */ + public List getRemoveEvents() { + return removeEvents; + } + + /** + * @return the events + */ + public E getLastRemoveEvents() { + if(removeEvents.size()>0) { + return removeEvents.get(removeEvents.size() -1); + } + + return null; + } + + public void elementAdded(E element) { + addEvents.add(element); + } + + public void elementRemoved(E element) { + removeEvents.add(element); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/ObservableListTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/ObservableListTest.java new file mode 100644 index 00000000000..e69925c2c72 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.tests/test/org/eclipse/papyrus/infra/core/sasheditor/utils/ObservableListTest.java @@ -0,0 +1,173 @@ +/***************************************************************************** + * Copyright (c) 2013 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.core.sasheditor.utils; + +import static org.junit.Assert.*; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + + +/** + * @author cedric dumoulin + * + */ +public class ObservableListTest { + + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + } + + /** + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.utils.ObservableList#ObservableList()}. + */ + @Test + public void testObservableList() { + ObservableList list = new ObservableList(); + assertNotNull("list created", list); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.utils.ObservableList#addListener(org.eclipse.papyrus.infra.core.sasheditor.utils.IObservableListListener)}. + */ + @Test + public void testAddListener() { + ObservableList list = new ObservableList(); + assertNotNull("list created", list); + + FakeObservableListener listener = new FakeObservableListener(); + + // add a listener + list.addListener(listener); + // Check if added + assertTrue("listener added", list.getListeners().contains(listener)); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.utils.ObservableList#removeListener(org.eclipse.papyrus.infra.core.sasheditor.utils.IObservableListListener)}. + */ + @Test + public void testRemoveListener() { + ObservableList list = new ObservableList(); + assertNotNull("list created", list); + + FakeObservableListener listener = new FakeObservableListener(); + + // add a listener + list.addListener(listener); + // Check if added + assertTrue("listener added", list.getListeners().contains(listener)); + + list.removeListener(listener); + // Check if added + assertFalse("list contains listener", list.getListeners().contains(listener)); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.utils.ObservableList#fireElementAddedEvent(java.lang.Object)}. + */ + @Test + public void testFireElementAddedEvent() { + ObservableList list = new ObservableList(); + assertNotNull("list created", list); + + FakeObservableListener listener = new FakeObservableListener(); + + // add a listener + list.addListener(listener); + // Check event + + list.fireElementAddedEvent("string1"); + assertEquals( "event fired", "string1", listener.getLastAddEvents() ); + + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.sasheditor.utils.ObservableList#fireElementRemovedEvent(java.lang.Object)}. + */ + @Test + public void testFireElementRemovedEvent() { + ObservableList list = new ObservableList(); + assertNotNull("list created", list); + + FakeObservableListener listener = new FakeObservableListener(); + + // add a listener + list.addListener(listener); + // Check event + String element = "string1"; + list.fireElementRemovedEvent(element); + assertEquals( "event fired", element, listener.getLastRemoveEvents() ); + } + + /** + * Test method for add}. + */ + @Test + public void testAdd() { + ObservableList list = new ObservableList(); + assertNotNull("list created", list); + + FakeObservableListener listener = new FakeObservableListener(); + + // add a listener + list.addListener(listener); + // Check event + + String element = "string1"; + + list.add(element); + assertEquals( "event fired", element, listener.getLastAddEvents() ); + assertEquals( "element added to list", element, list.get(list.size()-1) ); + + } + + /** + * Test method for add}. + */ + @Test + public void testRemove() { + ObservableList list = new ObservableList(); + assertNotNull("list created", list); + + FakeObservableListener listener = new FakeObservableListener(); + + // add a listener + list.addListener(listener); + // Check event + + String element = "string1"; + list.add(element); + assertEquals( "element added to list", element, list.get(list.size()-1) ); + + list.remove(element); + assertFalse( "element removed from list", list.contains(element) ); + assertEquals( "event fired", element, listener.getLastRemoveEvents() ); + + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.classpath b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.classpath new file mode 100755 index 00000000000..83be1d9f78c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.project b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.project new file mode 100755 index 00000000000..4f4672ffbd7 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.infra.core.suite.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/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.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/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100755 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/.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/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/META-INF/MANIFEST.MF new file mode 100755 index 00000000000..5c885189255 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/META-INF/MANIFEST.MF @@ -0,0 +1,20 @@ +Manifest-Version: 1.0 +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 0.0.1.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.infra.core.suite.tests.Activator +Bundle-SymbolicName: org.eclipse.papyrus.infra.core.suite.tests +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +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", + org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.sasheditor.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.sasheditor.di.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.clipboard.tests;bundle-version="1.2.0" + \ No newline at end of file diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/Papyrus Core tests.launch b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/Papyrus Core tests.launch new file mode 100755 index 00000000000..2cc281f797c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/Papyrus Core tests.launch @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/about.html b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/about.html new file mode 100755 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/about.html @@ -0,0 +1,28 @@ + + + + +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/infra/core/org.eclipse.papyrus.infra.core.suite.tests/build.properties b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/build.properties new file mode 100755 index 00000000000..397cafd8221 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/build.properties @@ -0,0 +1,7 @@ +source.. = test/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + about.html,\ + Papyrus Core tests.launch diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/plugin.properties b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/plugin.properties new file mode 100755 index 00000000000..66285944234 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/plugin.properties @@ -0,0 +1,12 @@ +################################################################################# +# 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=Infra core Tests suite for Papyrus +providerName=Eclipse Modeling Project diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/pom.xml b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/pom.xml new file mode 100755 index 00000000000..f0421acc246 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/pom.xml @@ -0,0 +1,56 @@ + + + 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.infra.core.suite.tests + 0.0.1-SNAPSHOT + eclipse-test-plugin + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + true + true + true + org.eclipse.sdk.ide + + ${skipAllTests} + org.eclipse.papyrus.infra.core.suite.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 + + + + + + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/test/org/eclipse/papyrus/infra/core/suite/tests/Activator.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/test/org/eclipse/papyrus/infra/core/suite/tests/Activator.java new file mode 100755 index 00000000000..10363d5d0e8 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/test/org/eclipse/papyrus/infra/core/suite/tests/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.infra.core.suite.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.infra.core.suite.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) + */ + @Override + 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) + */ + @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; + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/test/org/eclipse/papyrus/infra/core/suite/tests/AllTests.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/test/org/eclipse/papyrus/infra/core/suite/tests/AllTests.java new file mode 100755 index 00000000000..e1f3b254fc0 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.suite.tests/test/org/eclipse/papyrus/infra/core/suite/tests/AllTests.java @@ -0,0 +1,51 @@ +/***************************************************************************** + * 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.infra.core.suite.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<>(); + + /* **************** plugins *********************** */ + + /* core */ + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.core.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.core.clipboard.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.core.sasheditor.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.core.sasheditor.di.tests.AllTests.class)); + + // end + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/.classpath b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/.classpath new file mode 100644 index 00000000000..e5fa400a126 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/.project b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/.project new file mode 100644 index 00000000000..6fa5321eac5 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.infra.core.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/infra/core/org.eclipse.papyrus.infra.core.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/.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/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/.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/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..69403e3c645 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Require-Bundle: org.junit;bundle-version="4.10.0", + org.eclipse.papyrus.junit.framework;bundle-version="1.2.0", + org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core;bundle-version="1.2.0" +Export-Package: org.eclipse.papyrus.infra.core.resource, + org.eclipse.papyrus.infra.core.services, + org.eclipse.papyrus.infra.core.tests +Bundle-Vendor: %providerName +Bundle-Version: 1.2.0.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.infra.core.tests;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/about.html b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/about.html new file mode 100644 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/about.html @@ -0,0 +1,28 @@ + + + + +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/infra/core/org.eclipse.papyrus.infra.core.tests/build.properties b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/build.properties new file mode 100644 index 00000000000..abe693aba0b --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/build.properties @@ -0,0 +1,9 @@ +source.. = test/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.properties,\ + plugin.xml,\ + resources/ +src.includes = about.html diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/org.eclipse.papyrus.infra.core.tests.launch b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/org.eclipse.papyrus.infra.core.tests.launch new file mode 100644 index 00000000000..8823f1a8091 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/org.eclipse.papyrus.infra.core.tests.launch @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/plugin.properties b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/plugin.properties new file mode 100644 index 00000000000..d2860c1b07d --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/plugin.properties @@ -0,0 +1,12 @@ +################################################################################# +# 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: +# Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - initial API and implementation +################################################################################## +pluginName=Papyrus Core Test +providerName=Eclipse Modeling Project diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/plugin.xml b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/plugin.xml new file mode 100644 index 00000000000..4be7351f353 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/plugin.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/pom.xml b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/pom.xml new file mode 100644 index 00000000000..f14f585d5ea --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + + org.eclipse.papyrus + org.eclipse.papyrus.tests.releng + 1.2.0-SNAPSHOT + ../../../../../../releng/main-tests + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.core.tests + 1.2.0-SNAPSHOT + eclipse-test-plugin + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/resources/My.ecore b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/resources/My.ecore new file mode 100644 index 00000000000..c35981cf49d --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/resources/My.ecore @@ -0,0 +1,6 @@ + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/resources/My.genmodel b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/resources/My.genmodel new file mode 100644 index 00000000000..9495ce441eb --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/resources/My.genmodel @@ -0,0 +1,11 @@ + + + My.ecore + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/language/LanguageServiceTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/language/LanguageServiceTest.java new file mode 100644 index 00000000000..3530a06d78e --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/language/LanguageServiceTest.java @@ -0,0 +1,191 @@ +/***************************************************************************** + * 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.infra.core.language; + +import static java.util.stream.StreamSupport.stream; +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +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.resource.Resource; +import org.eclipse.papyrus.infra.core.Activator; +import org.eclipse.papyrus.infra.core.internal.language.LanguageModelRegistry; +import org.eclipse.papyrus.infra.core.resource.IEMFModel; +import org.eclipse.papyrus.infra.core.resource.IModel; +import org.eclipse.papyrus.infra.core.resource.ModelMultiException; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.services.ExtensionServicesRegistry; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServiceMultiException; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.core.utils.TransactionHelper; +import org.eclipse.papyrus.junit.utils.resources.EcoreModel; +import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; +import org.eclipse.papyrus.junit.utils.rules.ModelSetFixture; +import org.eclipse.papyrus.junit.utils.rules.PluginResource; +import org.eclipse.papyrus.junit.utils.rules.ServiceRegistryModelSetFixture; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; + +/** + * Tests the Papyrus Language Service. + */ +@PluginResource({ "resources/My.ecore", "resources/My.genmodel" }) +public class LanguageServiceTest { + private static final String ECORE_LANGUAGE_ID = "org.eclipse.papyrus.infra.core.tests.language.ecore"; //$NON-NLS-1$ + private static final String ECORE_LANGUAGE_VERSION = "2.11"; //$NON-NLS-1$ + private static final String ECORE_LANGUAGE_NAME = "Ecore"; //$NON-NLS-1$ + + private static final String GENMODEL_LANGUAGE_ID = "org.eclipse.papyrus.infra.core.tests.language.genmodel"; //$NON-NLS-1$ + private static final String GENMODEL_LANGUAGE_VERSION = "2.11.0.v20150518-0831"; //$NON-NLS-1$ + private static final String GENMODEL_LANGUAGE_NAME = "Genmodel"; //$NON-NLS-1$ + + @ClassRule + public static final ModelSetFixture modelSet = new ServiceRegistryModelSetFixture(); + + private static IModel ecoreModel; + + @Rule + public final HouseKeeper houseKeeper = new HouseKeeper(); + + public LanguageServiceTest() { + super(); + } + + @Test + public void contentTypeBasedLanguages() throws ServiceException { + ILanguageService service = modelSet.requireService(ILanguageService.class); + + ILanguage ecore = null; + ILanguage genmodel = null; + for (ILanguage next : service.getLanguages(modelSet.getProject().getURI("My.ecore"), true)) { + if (ECORE_LANGUAGE_ID.equals(next.getID())) { + ecore = next; + } else if (GENMODEL_LANGUAGE_ID.equals(next.getID())) { + genmodel = next; + } + } + + assertThat(genmodel, nullValue()); // Asked only about the *.ecore resource + + assertThat(ecore, notNullValue()); + assertThat(ecore.getVersion(), is(new Version(ECORE_LANGUAGE_VERSION))); + assertThat(ecore.getName(), is(ECORE_LANGUAGE_NAME)); + } + + @Test + public void contentTypeBasedLanguages_uriWithoutExtension() throws ServiceException { + ILanguageService service = modelSet.requireService(ILanguageService.class); + + ILanguage ecore = null; + ILanguage genmodel = null; + for (ILanguage next : service.getLanguages(modelSet.getProject().getURI("My"), false)) { + if (ECORE_LANGUAGE_ID.equals(next.getID())) { + ecore = next; + } else if (GENMODEL_LANGUAGE_ID.equals(next.getID())) { + genmodel = next; + } + } + + assertThat(ecore, notNullValue()); + assertThat(ecore.getVersion(), is(new Version(ECORE_LANGUAGE_VERSION))); + assertThat(ecore.getName(), is(ECORE_LANGUAGE_NAME)); + + assertThat(genmodel, notNullValue()); + assertThat(genmodel.getVersion(), is(new Version(GENMODEL_LANGUAGE_VERSION))); + assertThat(genmodel.getName(), is(GENMODEL_LANGUAGE_NAME)); + } + + @Test + public void languageBindings() { + Collection models = ILanguageService.getLanguageModels(modelSet.getResourceSet()); + + assertThat(models, hasItem(ecoreModel)); + } + + @Test + public void contentBasedLanguagesInNewModel() throws Exception { + ServicesRegistry services = houseKeeper.cleanUpLater(new ExtensionServicesRegistry(Activator.PLUGIN_ID), reg -> { + try { + reg.disposeRegistry(); + } catch (ServiceMultiException e) { + // We expect these in the tests + } + }); + + try { + services.startRegistry(); + } catch (ServiceMultiException e) { + // These are normal + } + + ModelSet modelSet = services.getService(ModelSet.class); + + IEMFModel ecore = new EcoreModel(); + modelSet.registerModel(ecore); + + URI uri = URI.createURI("platform:/resource/test/bogus.ecore", true); + EPackage ePackage = EcoreFactory.eINSTANCE.createEPackage(); + Resource resource = modelSet.createResource(uri); + + TransactionHelper.run(modelSet.getTransactionalEditingDomain(), () -> { + resource.getContents().add(ePackage); + }); + + try { + modelSet.loadModels(uri); + } catch (ModelMultiException e) { + // We expect this + } + + List semanticRoots = ILanguageService.getLanguageModels(modelSet).stream() + .filter(IEMFModel.class::isInstance) + .map(IEMFModel.class::cast) + .flatMap(m -> stream(m.getRootElements().spliterator(), false)) + .collect(Collectors.toList()); + + assertThat(semanticRoots, hasItem(ePackage)); + } + + // + // Test framework + // + + @BeforeClass + public static void registerEcoreModel() { + ecoreModel = new EcoreModel(); + LanguageModelRegistry.INSTANCE.bind(ECORE_LANGUAGE_ID, ecoreModel.getIdentifier()); + + modelSet.getResourceSet().getInternal().registerModel(ecoreModel, false); + } + + @AfterClass + public static void unregisterEcoreModel() { + LanguageModelRegistry.INSTANCE.bind(ECORE_LANGUAGE_ID, ecoreModel.getIdentifier()); + ecoreModel = null; + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractModelWithSharedResourceTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractModelWithSharedResourceTest.java new file mode 100644 index 00000000000..f316787db54 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractModelWithSharedResourceTest.java @@ -0,0 +1,328 @@ +/***************************************************************************** + * Copyright (c) 2010, 2014 LIFL, 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: + * LIFL - Initial API and implementation + * Christian W. Damus (CEA) - bug 436047 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.resource; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.util.List; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EcoreFactory; +import org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource.ModelKind; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + + +/** + * Run as "JUnit Plugin-Test" + * + * @author cedric dumoulin + * + */ +public class AbstractModelWithSharedResourceTest extends AbstractPapyrusTest { + + @Rule + public final HouseKeeper houseKeeper = new HouseKeeper(); + + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + } + + /** + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + } + + /** + * Test that the resource is created only once. + * Test method for {@link org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#createModel(org.eclipse.core.runtime.IPath)}. + */ + @Test + public void testCreateModel() { + + String model1Key = "ecore"; + String model2Key = "genmodel"; + + // Create models with different key, but use same extension (default from FakeModelWithSharedResource) + FakeModelWithSharedResource model1 = new FakeModelWithSharedResource(ModelKind.master, model1Key, EPackage.class); + FakeModelWithSharedResource model2 = new FakeModelWithSharedResource(model2Key, EClass.class); + + ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); + modelSet.registerModel(model1); + modelSet.registerModel(model2); + + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); + + IFile model1File = p.getFile("tmp/model1." + model1Key); + + // Call creates + modelSet.createsModels(model1File); + + // Do check + assertNotNull("resource created", model1.getResouce()); + assertNotNull("resource created", model2.getResouce()); + assertEquals("Resource is shared", model1.getResouce(), model2.getResouce()); + + + } + + /** + * Create and save models. + * + * @throws IOException + * @throws CoreException + */ + private void createAndSave(String model1Key, String model2Key) throws IOException, CoreException { + + FakeModelWithSharedResource model1 = new FakeModelWithSharedResource(ModelKind.master, model1Key, EPackage.class); + FakeModelWithSharedResource model2 = new FakeModelWithSharedResource(model2Key, EClass.class); + + ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); + modelSet.registerModel(model1); + modelSet.registerModel(model2); + + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); + if(!p.exists()) { + p.create(new NullProgressMonitor()); + } + p.open(new NullProgressMonitor()); + + IFile model1File = p.getFile("tmp/model1." + model1Key); + + // Call creates and save + + modelSet.createsModels(model1File); + model1.getResouce().setModified(true); + modelSet.save(new NullProgressMonitor()); + modelSet.unload(); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#loadModel(org.eclipse.core.runtime.IPath)}. + * + * @throws CoreException + * @throws IOException + * @throws ModelMultiException + */ + @Test + public void testLoadModelIPath() throws IOException, CoreException, ModelMultiException { + + + String model1Key = "ecore"; + String model2Key = "genmodel"; + + createAndSave(model1Key, model2Key); + + FakeModelWithSharedResource model1 = new FakeModelWithSharedResource(ModelKind.master, model1Key, EPackage.class); + FakeModelWithSharedResource model2 = new FakeModelWithSharedResource(model2Key, EClass.class); + + ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); + modelSet.registerModel(model1); + modelSet.registerModel(model2); + + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); + + IFile model1File = p.getFile("tmp/model1." + model1Key); + + // Call creates + modelSet.loadModels(model1File); + + // Do check + assertNotNull("resource loaded", model1.getResouce()); + assertNotNull("resource loaded", model2.getResouce()); + assertEquals("Resource is shared", model1.getResouce(), model2.getResouce()); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#saveModel()}. + * + * @throws IOException + * @throws CoreException + */ + @Test + public void testSaveModel() throws IOException, CoreException { + String model1Key = "ecore"; + String model2Key = "genmodel"; + + FakeModelWithSharedResource model1 = new FakeModelWithSharedResource(ModelKind.master, model1Key, EPackage.class); + FakeModelWithSharedResource model2 = new FakeModelWithSharedResource(model2Key, EClass.class); + + ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); + modelSet.registerModel(model1); + modelSet.registerModel(model2); + + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); + if(!p.exists()) { + p.create(new NullProgressMonitor()); + } + p.open(new NullProgressMonitor()); + + IFile model1File = p.getFile("tmp/model1." + model1Key); + + // Call creates and save + + modelSet.createsModels(model1File); + model1.getResouce().setModified(true); + modelSet.save(new NullProgressMonitor()); + + // Do check + assertNotNull("resource created", model1.getResouce()); + assertNotNull("resource created", model2.getResouce()); + assertEquals("Resource is shared", model1.getResouce(), model2.getResouce()); + // Check weither it is save + assertFalse("Resource is saved", model1.getResouce().isModified()); + assertFalse("Resource is saved", model2.getResouce().isModified()); + // TODO : check that it is saved only once ! + + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#getModelRoot()}. + */ + @Test + public void testGetModelRoot() { + String model1Key = "ecore"; + String model2Key = "genmodel"; + + FakeModelWithSharedResource model1 = new FakeModelWithSharedResource(ModelKind.master, model1Key, EPackage.class); + FakeModelWithSharedResource model2 = new FakeModelWithSharedResource(model2Key, EClass.class); + + ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); + modelSet.registerModel(model1); + modelSet.registerModel(model2); + + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); + + IFile model1File = p.getFile("tmp/model1." + model1Key); + + // Call creates + modelSet.createsModels(model1File); + // Add elements in both model + EPackage p1 = EcoreFactory.eINSTANCE.createEPackage(); + model1.addModelRoot(p1); + + EClass c1 = EcoreFactory.eINSTANCE.createEClass(); + model2.addModelRoot(c1); + + // Do check + assertEquals("root found", p1, model1.getModelRoot()); + assertEquals("root found", c1, model2.getModelRoot()); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#getModelRoot()}. + */ + @Test + public void testGetModelRoots() { + String model1Key = "ecore"; + String model2Key = "genmodel"; + + FakeModelWithSharedResource model1 = new FakeModelWithSharedResource(ModelKind.master, model1Key, EPackage.class); + FakeModelWithSharedResource model2 = new FakeModelWithSharedResource(model2Key, EClass.class); + + ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); + modelSet.registerModel(model1); + modelSet.registerModel(model2); + + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); + + IFile model1File = p.getFile("tmp/model1." + model1Key); + + // Call creates + modelSet.createsModels(model1File); + // Add elements in both model + EPackage p1 = EcoreFactory.eINSTANCE.createEPackage(); + model1.addModelRoot(p1); + EPackage p2 = EcoreFactory.eINSTANCE.createEPackage(); + model1.addModelRoot(p2); + EPackage p3 = EcoreFactory.eINSTANCE.createEPackage(); + model1.addModelRoot(p3); + + EClass c1 = EcoreFactory.eINSTANCE.createEClass(); + model2.addModelRoot(c1); + EClass c2 = EcoreFactory.eINSTANCE.createEClass(); + model2.addModelRoot(c2); + EClass c3 = EcoreFactory.eINSTANCE.createEClass(); + model2.addModelRoot(c3); + + // Do check + List lp = model1.getModelRoots(); + List lc = model2.getModelRoots(); + + assertNotNull("list exist", lp); + assertEquals("list size", 3, lp.size()); + assertTrue("element found", lp.contains(p1)); + assertTrue("element found", lp.contains(p2)); + assertTrue("element found", lp.contains(p3)); + + assertNotNull("list exist", lc); + assertEquals("list size", 3, lc.size()); + assertTrue("element found", lc.contains(c1)); + assertTrue("element found", lc.contains(c2)); + assertTrue("element found", lc.contains(c3)); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#addModelRoot(org.eclipse.emf.ecore.EObject)}. + */ + @Test + public void testAddModelRoot() { + String model1Key = "ecore"; + String model2Key = "genmodel"; + + FakeModelWithSharedResource model1 = new FakeModelWithSharedResource(ModelKind.master, model1Key, EPackage.class); + FakeModelWithSharedResource model2 = new FakeModelWithSharedResource(model2Key, EClass.class); + + ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); + modelSet.registerModel(model1); + modelSet.registerModel(model2); + + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); + + IFile model1File = p.getFile("tmp/model1." + model1Key); + + // Call creates + modelSet.createsModels(model1File); + // Add elements in both model + EPackage p1 = EcoreFactory.eINSTANCE.createEPackage(); + model1.addModelRoot(p1); + + EClass c1 = EcoreFactory.eINSTANCE.createEClass(); + model2.addModelRoot(c1); + + // Do check + assertTrue("model contain element", model1.getResouce().getContents().contains(p1)); + assertTrue("model contain element", model2.getResouce().getContents().contains(c1)); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractResourceAdapterTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractResourceAdapterTest.java new file mode 100644 index 00000000000..0803216621e --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/AbstractResourceAdapterTest.java @@ -0,0 +1,351 @@ +/* + * 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 482949 + * + */ +package org.eclipse.papyrus.infra.core.resource; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.util.Set; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EcoreFactory; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceImpl; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.eclipse.papyrus.junit.utils.rules.AbstractHouseKeeperRule.CleanUp; +import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; + + +/** + * Abstract test suite for the {@link ResourceAdapter} class, providing tests + * for both the base and transactional variants. + */ +public abstract class AbstractResourceAdapterTest extends AbstractPapyrusTest { + + private static final String RESOURCE_ADDED = "handleResourceAdded"; + + private static final String RESOURCE_REMOVED = "handleResourceRemoved"; + + private static final String RESOURCE_LOADED = "handleResourceLoaded"; + + private static final String RESOURCE_UNLOADED = "handleResourceUnloaded"; + + private static final String RESOURCE_URI = "handleResourceURI"; + + private static final String RESOURCE_ROOT_ADDED = "handleRootAdded"; + + private static final String RESOURCE_ROOT_REMOVED = "handleRootRemoved"; + + @Rule + public final HouseKeeper houseKeeper = new HouseKeeper(); + + private T target; + + private ResourceSet rset; + + @CleanUp + private Fixture fixture; + + public AbstractResourceAdapterTest() { + super(); + } + + @Test + public void testResourceAdded() { + Resource res = new ResourceImpl(); + execute(() -> rset.getResources().add(res)); + + fixture.assertHooks(RESOURCE_ADDED); + fixture.assertResources(res); + } + + @Test + public void testResourceRemoved() { + Resource res = new ResourceImpl(); + execute(() -> rset.getResources().add(res)); + + fixture.reset(); + execute(() -> rset.getResources().remove(0)); + + fixture.assertHooks(RESOURCE_REMOVED); + fixture.assertResources(res); + } + + @Test + public void testResourceLoaded() { + Resource res = rset.createResource(getTestResourceURI()); + + fixture.reset(); + safeExecute(() -> res.load(null)); + + fixture.assertHooks(RESOURCE_LOADED); + fixture.assertResources(res); + } + + @Test + public void testResourceUnloaded() { + Resource res = rset.getResource(getTestResourceURI(), true); + + fixture.reset(); + execute(() -> res.unload()); + + fixture.assertHooks(RESOURCE_UNLOADED); + fixture.assertResources(res); + } + + @Test + public void testResourceURI() { + URI oldURI = getTestResourceURI(); + Resource res = rset.getResource(oldURI, true); + + fixture.reset(); + URI newURI = URI.createURI("http:///bogus.ecore"); + execute(() -> res.setURI(newURI)); + + fixture.assertHooks(RESOURCE_URI); + fixture.assertResources(res); + fixture.assertURIs(oldURI, newURI); + } + + @Test + public void testRootAdded() { + Resource res = rset.getResource(getTestResourceURI(), true); + + fixture.reset(); + EObject root = EcoreFactory.eINSTANCE.createEObject(); + execute(() -> res.getContents().add(root)); + + fixture.assertHooks(RESOURCE_ROOT_ADDED); + fixture.assertResources(res); + fixture.assertRoots(root); + } + + @Test + public void testRootRemoved() { + Resource res = rset.getResource(getTestResourceURI(), true); + + fixture.reset(); + EObject root = res.getContents().get(0); + execute(() -> res.getContents().remove(root)); + + fixture.assertHooks(RESOURCE_ROOT_REMOVED); + fixture.assertResources(res); + fixture.assertRoots(root); + } + + @Test + public void testChangesInPreexistingResources_bug481151() { + // Need a different one than the usual, which already has the fixture attached + T newTarget = createTarget(houseKeeper); + ResourceSet newRset = getResourceSet(newTarget); + + // A pre-existing resource + Resource resource = new ResourceImpl(URI.createURI("bogus://test")); + execute(() -> newRset.getResources().add(resource)); + + fixture.install(newTarget); + + // Consequence of initial discovery + fixture.assertHooks(RESOURCE_ADDED); + fixture.reset(); + + EObject newRoot = EcoreFactory.eINSTANCE.createEObject(); + execute(() -> resource.getContents().add(newRoot)); + + // An unloaded resource becomes implicitly loaded when its contents are changed + if (isTransactional()) { + // In the transactional case, all observations are delayed until the end + // of the transaction, so if a resource was loaded during the transaction, + // it doesn't matter what else happened to its contents because we don't + // observe any of those contents until later. So, there is no distinction + // to be had in the additional root-add event, and it isn't observed + fixture.assertHooks(RESOURCE_LOADED); + } else { + // In the non-transactional case, the add happens after load has completed, + // so the resource is no longer loading at that point, and we observe the + // root being added + fixture.assertHooks(RESOURCE_LOADED, RESOURCE_ROOT_ADDED); + } + } + + @Test + public void testUninstallResourceAdapter_bug482949() { + // uninstall now + fixture.uninstall(target); + + // We should not observe any events + Resource res = new ResourceImpl(); + execute(() -> rset.getResources().add(res)); + + fixture.assertHooks(); + fixture.assertResources(); + } + + // + // Test framework + // + + @Before + public void createFixture() { + target = createTarget(houseKeeper); + rset = getResourceSet(target); + fixture = doCreateFixture(); + + fixture.install(target); + houseKeeper.cleanUpLater(fixture, f -> f.uninstall(target)); + } + + protected boolean isTransactional() { + return false; + } + + protected abstract T createTarget(HouseKeeper keeper); + + protected abstract ResourceSet getResourceSet(T target); + + protected abstract void execute(Runnable command); + + protected abstract void safeExecute(RunnableWithException command); + + protected abstract Fixture doCreateFixture(); + + protected final T getTarget() { + return target; + } + + URI getTestResourceURI() { + // Doesn't matter the resource; this one's conveniently available + return URI.createURI(getClass().getResource("Bug402525.ecore").toExternalForm(), true); + } + + // + // Nested types + // + + protected abstract class Fixture { + + private Set resources = Sets.newHashSet(); + + private Set hooksCalled = Sets.newHashSet(); + + private Set roots = Sets.newHashSet(); + + private URI oldURI; + + private URI newURI; + + private A adapter; + + void reset() { + resources.clear(); + hooksCalled.clear(); + roots.clear(); + oldURI = null; + newURI = null; + } + + void assertResources(Resource... resources) { + assertThat(this.resources, is((Set) ImmutableSet.copyOf(resources))); + } + + void assertHooks(String... hooks) { + assertThat(this.hooksCalled, is((Set) ImmutableSet.copyOf(hooks))); + } + + void assertRoots(EObject... objects) { + assertThat(this.roots, is((Set) ImmutableSet.copyOf(objects))); + } + + void assertURIs(URI oldURI, URI newURI) { + assertThat(this.oldURI, is(oldURI)); + assertThat(this.newURI, is(newURI)); + } + + private void called(Resource resource, String hook) { + hooksCalled.add(hook); + resources.add(resource); + } + + private void root(EObject root) { + roots.add(root); + } + + private void uri(URI oldURI, URI newURI) { + this.oldURI = oldURI; + this.newURI = newURI; + } + + protected void handleResourceAdded(Resource resource) { + called(resource, RESOURCE_ADDED); + } + + protected void handleResourceRemoved(Resource resource) { + called(resource, RESOURCE_REMOVED); + } + + protected void handleResourceLoaded(Resource resource) { + called(resource, RESOURCE_LOADED); + } + + protected void handleResourceUnloaded(Resource resource) { + called(resource, RESOURCE_UNLOADED); + } + + protected void handleResourceURI(Resource resource, URI oldURI, URI newURI) { + called(resource, RESOURCE_URI); + uri(oldURI, newURI); + } + + protected void handleRootAdded(Resource resource, EObject root) { + called(resource, RESOURCE_ROOT_ADDED); + root(root); + } + + protected void handleRootRemoved(Resource resource, EObject root) { + called(resource, RESOURCE_ROOT_REMOVED); + root(root); + } + + void install(T target) { + adapter = createAdapter(); + doInstall(adapter, target); + } + + void uninstall(T target) { + if (adapter != null) { + doUninstall(adapter, target); + adapter = null; + } + } + + protected abstract A createAdapter(); + + protected abstract void doInstall(A adapter, T target); + + protected abstract void doUninstall(A adapter, T target); + } + + @FunctionalInterface + protected interface RunnableWithException { + void run() throws Exception; + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/Bug402525.ecore b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/Bug402525.ecore new file mode 100644 index 00000000000..8dea18de3e8 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/Bug402525.ecore @@ -0,0 +1,6 @@ + + + + diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModel.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModel.java new file mode 100644 index 00000000000..0f6c114bdcd --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModel.java @@ -0,0 +1,67 @@ +/***************************************************************************** + * Copyright (c) 2011, 2016 LIFL, 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: + * LIFL - Initial API and implementation + * Christian W. Damus - bugs 485220, 488791 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.resource; + +import org.eclipse.emf.ecore.EObject; + +/** + * @author dumoulin + * + */ +public class FakeModel extends AbstractBaseModel { + + private String identifier; + + public FakeModel(String identifier) { + this.identifier = identifier; + } + + /** + * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getIdentifier() + * + * @return + */ + @Override + public String getIdentifier() { + // TODO Auto-generated method stub + return identifier; + } + + /** + * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getModelFileExtension() + * + * @return + */ + @Override + protected String getModelFileExtension() { + // TODO Auto-generated method stub + return identifier; + } + + @Override + public boolean canPersist(EObject object) { + return false; + } + + @Override + public void persist(EObject object) { + throw new IllegalArgumentException("cannot persist " + object); //$NON-NLS-1$ + } + + // Overridden to make it accessible + @Override + protected ModelSet getModelManager() { + return super.getModelManager(); + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelManagerSnippet.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelManagerSnippet.java new file mode 100644 index 00000000000..d7f5883e84c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelManagerSnippet.java @@ -0,0 +1,62 @@ +/** + * + */ +package org.eclipse.papyrus.infra.core.resource; + + + +/** + * a fake {@link IModelSetSnippet} for test purpose. + * + * @author cedric dumoulin + * + */ +public class FakeModelManagerSnippet implements IModelSetSnippet { + + private TestTrace trace; + + private String name; + + /** + * + * Constructor. + * + * @param string + */ + public FakeModelManagerSnippet(String name) { + this.trace = new TestTrace(); + this.name = name; + } + + /** + * + * Constructor. + * + * @param trace2 + * @param string + */ + public FakeModelManagerSnippet(TestTrace trace, String name) { + this.trace = trace; + this.name = name; + } + + /** + * @see org.eclipse.papyrus.infra.core.resource.IModelSetSnippet#start(org.eclipse.papyrus.infra.core.resource.ModelSet) + * + * @param modelsManager + */ + public void start(ModelSet modelsManager) { + trace.addTrace(name, "start"); + } + + /** + * @see org.eclipse.papyrus.infra.core.resource.IModelSetSnippet#dispose(org.eclipse.papyrus.infra.core.resource.ModelSet) + * + * @param modelsManager + */ + public void dispose(ModelSet modelsManager) { + trace.addTrace(name, "dispose"); + + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelWithSharedResource.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelWithSharedResource.java new file mode 100644 index 00000000000..3f9e7a38d29 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/FakeModelWithSharedResource.java @@ -0,0 +1,100 @@ +/** + * + */ +package org.eclipse.papyrus.infra.core.resource; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; + + +/** + * @author dumoulin + * + */ +public class FakeModelWithSharedResource extends AbstractModelWithSharedResource { + + private String identifier; + private String fileExtension; + private Class expectedType; + + /** + * + * Constructor. + * + * @param kind + * @param identifier + * @param fileExtension + * @param expectedType + */ + public FakeModelWithSharedResource(ModelKind kind, String identifier, String fileExtension, Class expectedType) { + super(kind); + this.identifier = identifier; + this.expectedType = expectedType; + this.fileExtension = fileExtension; + } + + /** + * + * Constructor. + * + * @param kind + * @param identifier + * @param expectedType + */ + public FakeModelWithSharedResource(ModelKind kind, String identifier, Class expectedType) { + this(kind, identifier, "di", expectedType); + } + + /** + * + * Constructor. + * + * @param identifier + * @param expectedType + */ + public FakeModelWithSharedResource(String identifier, Class expectedType) { + this(ModelKind.slave, identifier, expectedType); + } + + /** + * + * @see org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#isModelRoot(org.eclipse.emf.ecore.EObject) + * + * @param object + * @return + */ + @Override + protected boolean isModelRoot(EObject object) { + return expectedType.isInstance(object); + } + + /** + * + * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getIdentifier() + * + * @return + */ + @Override + public String getIdentifier() { + return identifier; + } + + /** + * + * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getModelFileExtension() + * + * @return + */ + @Override + protected String getModelFileExtension() { + return fileExtension; + } + + /** + * Get the associated resource. + * @return + */ + public Resource getResouce() { + return resource; + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ModelSetTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ModelSetTest.java new file mode 100644 index 00000000000..d06b7d25e1c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ModelSetTest.java @@ -0,0 +1,691 @@ +/***************************************************************************** + * Copyright (c) 2010, 2015 LIFL, 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: + * LIFL - Initial API and implementation + * Christian W. Damus (CEA) - bug 422257 + * Christian W. Damus (CEA) - bug 436047 + * Christian W. Damus (CEA) - bug 437052 + * Christian W. Damus - bug 481149 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.resource; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.util.Set; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +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.common.util.URI; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EcoreFactory; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.edit.command.SetCommand; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.papyrus.infra.core.resource.additional.AdditionalResourcesModel; +import org.eclipse.papyrus.infra.core.utils.TransactionHelper; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.eclipse.papyrus.junit.utils.ModelUtils; +import org.eclipse.papyrus.junit.utils.resources.EcoreModel; +import org.eclipse.papyrus.junit.utils.resources.WorkspaceModificationAssertion; +import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; + +/** + * Test for {@link ModelSet}.
+ * Run as "JUnit Plugin-Test" + * + * @author cedric dumoulin + * + */ +public class ModelSetTest extends AbstractPapyrusTest { + + /** + * Name of the plugin that is created. + */ + final protected String PLUGIN_PROJECT_NAME = "org.eclipse.papyrus.infra.core"; + + @Rule + public final HouseKeeper houseKeeper = new HouseKeeper(); + + /** + * + * @throws Exception + */ + @Before + public void setUp() throws Exception { + } + + /** + * + * @throws Exception + */ + @After + public void tearDown() throws Exception { + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet.registerModel(IModel)} . + */ + @Test + public void testRegisterModel() { + ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); + + FakeModel model1 = new FakeModel("model1"); + + mngr.registerModel(model1); + + assertNotNull("mngr is set", model1.getModelManager()); + assertNotNull("model is registered", mngr.getModel("model1")); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#getModel(String)} . + */ + @Test + public void testGetModel() { + ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); + + FakeModel model1 = new FakeModel("model1"); + FakeModel model2 = new FakeModel("model2"); + + mngr.registerModel(model1); + mngr.registerModel(model2); + + assertNotNull("model is registered", mngr.getModel("model1")); + assertNotNull("model is registered", mngr.getModel("model2")); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#getTransactionalEditingDomain()} . + */ + @Test + public void testGetTransactionalEditingDomain() { + ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); + + assertNotNull("editing domain created", mngr.getTransactionalEditingDomain()); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#createsModels(IFile)} . + */ + @Test + public void testCreatesModels() throws IOException, CoreException { + ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); + + String model1Key = "ecore"; + String model2Key = "genmodel"; + + FakeModel model1 = new FakeModel(model1Key); + FakeModel model2 = new FakeModel(model2Key); + + mngr.registerModel(model1); + mngr.registerModel(model2); + + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); + + IFile model1File = p.getFile("tmp/model1." + model1Key); + + // Do create + mngr.createsModels(model1File); + + assertNotNull("resource created", model1.getResource()); + assertNotNull("resource created", model2.getResource()); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#loadModels(IFile)} . + * + * @throws ModelMultiException + */ + @Test + public void testLoadModels() throws IOException, CoreException, ModelMultiException { + + // Create models so they exists + testSave(); + + // Now do load + ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); + + String model1Key = "ecore"; + String model2Key = "genmodel"; + + FakeModel model1 = new FakeModel(model1Key); + FakeModel model2 = new FakeModel(model2Key); + + mngr.registerModel(model1); + mngr.registerModel(model2); + + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); + + IFile model1File = p.getFile("tmp/model1." + model1Key); + IFile model2File = p.getFile("tmp/model1." + model2Key); + + assertTrue("modelFile exist", model1File.exists()); + assertTrue("modelFile exist", model2File.exists()); + + // Try to load + mngr.loadModels(model1File); + + assertNotNull("resource created", model1.getResource()); + assertNotNull("resource created", model2.getResource()); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#save(IProgressMonitor)} . + */ + @Test + public void testSave() throws CoreException, IOException { + ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); + + String model1Key = "ecore"; + String model2Key = "genmodel"; + + FakeModel model1 = new FakeModel(model1Key); + FakeModel model2 = new FakeModel(model2Key); + + mngr.registerModel(model1); + mngr.registerModel(model2); + + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); + if (!p.exists()) { + p.create(new NullProgressMonitor()); + } + p.open(new NullProgressMonitor()); + + IFile model1File = p.getFile("tmp/model1." + model1Key); + IFile model2File = p.getFile("tmp/model1." + model2Key); + + // Do create and save + mngr.createsModels(model1File); + mngr.save(new NullProgressMonitor()); + // + assertTrue("resource created", model1File.exists()); + assertTrue("resource created", model2File.exists()); + // + assertNotNull("resource created", model1.getResource()); + assertNotNull("resource created", model2.getResource()); + } + + /** + * Tests that only modified resources are saved, where we have only one model (no referenced libraries). + */ + @Test + public void testSave_onlyModifiedResources1() throws Exception { + ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); + TransactionalEditingDomain domain = houseKeeper.cleanUpLater(mngr.getTransactionalEditingDomain()); + + EcoreModel model = new EcoreModel(); + + mngr.registerModel(model); + mngr.registerModel(new AdditionalResourcesModel()); + + IProject p = houseKeeper.createProject(houseKeeper.getTestName()); + + final IFile modelFile = p.getFile("model1." + model.getModelFileExtension()); + final URI modelURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true); + + final WorkspaceModificationAssertion mods = new WorkspaceModificationAssertion(houseKeeper); + + mngr.createModels(modelURI); + mods.save(mngr); + + assertThat("workspace resource not created", modelFile.exists(), is(true)); + + assertThat("EMF resource is null", model.getResource(), notNullValue()); + assertThat("EMF resource not created", model.getResource().getContents().isEmpty(), is(false)); + + EPackage ePackage = model.getRoot(); + domain.getCommandStack().execute(SetCommand.create(domain, ePackage, EcorePackage.Literals.ENAMED_ELEMENT__NAME, "newname")); + + mods.requireChange(modelURI); + mods.save(mngr); + + // Saving again should have no effect on the workspace + mods.requireNoChange(modelURI); + mods.save(mngr); + } + + /** + * Tests that only modified resources are saved, where we have multiple models (referenced libraries). + */ + @Test + public void testSave_onlyModifiedResources2() throws Exception { + ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); + TransactionalEditingDomain domain = houseKeeper.cleanUpLater(mngr.getTransactionalEditingDomain()); + + final EcoreModel model = new EcoreModel(); + + mngr.registerModel(model); + mngr.registerModel(new AdditionalResourcesModel()); + + IProject p = houseKeeper.createProject(houseKeeper.getTestName()); + + final IFile modelFile1 = p.getFile("model1." + model.getModelFileExtension()); + final URI modelURI1 = URI.createPlatformResourceURI(modelFile1.getFullPath().toString(), true); + + final IFile modelFile2 = p.getFile("model2." + model.getModelFileExtension()); + final URI modelURI2 = URI.createPlatformResourceURI(modelFile2.getFullPath().toString(), true); + + final WorkspaceModificationAssertion mods = new WorkspaceModificationAssertion(houseKeeper); + + mngr.createModels(modelURI1); + + // Set up a second model and a dependency from the first + final Resource res2 = mngr.createResource(modelURI2, EcorePackage.eCONTENT_TYPE); + TransactionHelper.run(domain, new Runnable() { + + public void run() { + EPackage ePackage = EcoreFactory.eINSTANCE.createEPackage(); + ePackage.setName("library"); + ePackage.setNsPrefix("lib"); + ePackage.setNsURI("http://www.eclipse.org/papyrus/test/fakemodel/ecore/library"); + res2.getContents().add(ePackage); + + // A class in the library model + EClass foo = EcoreFactory.eINSTANCE.createEClass(); + foo.setName("Foo"); + ePackage.getEClassifiers().add(foo); + + // A class in the main model + EClass thing = EcoreFactory.eINSTANCE.createEClass(); + thing.setName("Thing"); + model.getRoot().getEClassifiers().add(thing); + + EReference reference = EcoreFactory.eINSTANCE.createEReference(); + reference.setName("foo"); + reference.setEType(foo); + thing.getEStructuralFeatures().add(reference); + } + }); + + // We need this referenced model to be writable in order to save it + ModelUtils.makeReferencedModelsWritable(mngr, modelURI2); + mods.save(mngr); + + assertThat("workspace resource not created", modelFile1.exists(), is(true)); + assertThat("workspace resource not created", modelFile2.exists(), is(true)); + + assertThat("EMF resource is null", model.getResource(), notNullValue()); + assertThat("EMF resource not created", model.getResource().getContents().isEmpty(), is(false)); + assertThat("EMF resource not created", res2.getContents().isEmpty(), is(false)); + + // Change the referenced resource's URI. This should make the resource and its dependents dirty + final URI modelURI2New = modelURI2.trimSegments(1).appendSegment("library1").appendFileExtension(model.getModelFileExtension()); + res2.setURI(modelURI2New); + + ModelUtils.makeReferencedModelsWritable(mngr, modelURI2New); + mods.requireChange(modelURI1); // Thanks to the ProxyModificationTrackingAdapter + mods.requireChange(modelURI2New); + mods.requireNoChange(modelURI2); // No longer an interesting URI + mods.save(mngr); + + EPackage ePackage = model.getRoot(); + domain.getCommandStack().execute(SetCommand.create(domain, ePackage, EcorePackage.Literals.ENAMED_ELEMENT__NAME, "newname")); + + // Saving this should have no effect on the second resource + mods.requireChange(modelURI1); + mods.requireNoChange(modelURI2New); + mods.requireNoChange(modelURI2); + mods.save(mngr); + } + + /** + * Create some Resources for other test. This method should be called explicitly. + * + * @throws CoreException + * @throws IOException + */ + protected void createResources(String... filenames) throws CoreException, IOException { + + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(PLUGIN_PROJECT_NAME); + if (!p.exists()) { + p.create(new NullProgressMonitor()); + } + p.open(new NullProgressMonitor()); + + ResourceSet resourceSet = houseKeeper.createResourceSet(); + + for (String filename : filenames) { + createResource(p, resourceSet, filename); + } + + // Save created resources + for (Resource resource : resourceSet.getResources()) { + resource.save(null); + } + } + + + /** + * Create a resource. + * + * @param p + * @param resourceSet + * @param filename + */ + private void createResource(IProject p, ResourceSet resourceSet, String filename) { + + // Build a valid file + IFile file = p.getFile(filename); + + + URI uri = URI.createPlatformResourceURI(file.getFullPath().toOSString(), true); + resourceSet.createResource(uri); + + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#saveAs(IPath)} . + */ + @Test + public void testSaveAs() throws CoreException, IOException { + ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); + + String model1Key = "ecore"; + String model2Key = "genmodel"; + + FakeModel model1 = new FakeModel(model1Key); + FakeModel model2 = new FakeModel(model2Key); + + mngr.registerModel(model1); + mngr.registerModel(model2); + + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); + if (!p.exists()) { + p.create(new NullProgressMonitor()); + } + p.open(new NullProgressMonitor()); + + IFile model1File = p.getFile("tmp/model1." + model1Key); + + // Do create and save + mngr.createsModels(model1File); + mngr.save(new NullProgressMonitor()); + + // Change the name + IFile newModel1File = p.getFile("tmp/model2." + model1Key); + IFile newModel2File = p.getFile("tmp/model2." + model2Key); + IPath newPath = newModel1File.getFullPath(); + + mngr.saveAs(newPath); + // check creation + + assertTrue("resource created", newModel2File.exists()); + assertTrue("resource created", newModel2File.exists()); + // + assertNotNull("resource created", model1.getResource()); + assertNotNull("resource created", model2.getResource()); + + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#unload()} . + */ + @Test + public void testUnload() { + ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); + + String model1Key = "ecore"; + String model2Key = "genmodel"; + + FakeModel model1 = new FakeModel(model1Key); + FakeModel model2 = new FakeModel(model2Key); + + mngr.registerModel(model1); + mngr.registerModel(model2); + + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); + + IFile model1File = p.getFile("tmp/model1." + model1Key); + + // Do create and then unload + mngr.createsModels(model1File); + mngr.unload(); + + assertNull("resource unloaded", model1.getResource()); + assertNull("resource unloaded", model2.getResource()); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.resource.ModelSet#addModelSetSnippet(IModelManagerSnippet)} . + */ + @Test + public void testAddModelSetSnippet() { + ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); + + // Add snippets + TestTrace trace = new TestTrace(); + mngr.addModelSetSnippet(new FakeModelManagerSnippet(trace, "snippet1")); + mngr.addModelSetSnippet(new FakeModelManagerSnippet(trace, "snippet2")); + + // Do create + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); + IFile model1File = p.getFile("tmp/model1.ecore"); + mngr.createsModels(model1File); + + // Check calls + assertTrue("snippet1 called", trace.contains("snippet1", "start")); + assertTrue("snippet2 called", trace.contains("snippet2", "start")); + + } + + /** + * Test that snippets are called after a call to createsModels() + */ + @Test + public void testSnippetCalledAfterCreateModels() { + ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); + + // Add snippets + TestTrace trace = new TestTrace(); + mngr.addModelSetSnippet(new FakeModelManagerSnippet(trace, "snippet1")); + mngr.addModelSetSnippet(new FakeModelManagerSnippet(trace, "snippet2")); + + // Do create + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); + IFile model1File = p.getFile("tmp/model1.ecore"); + mngr.createsModels(model1File); + + // Check calls + assertTrue("snippet1 called", trace.contains("snippet1", "start")); + assertTrue("snippet2 called", trace.contains("snippet2", "start")); + + // dispose + mngr.unload(); + // Check calls + assertTrue("snippet1 called", trace.contains("snippet1", "dispose")); + assertTrue("snippet2 called", trace.contains("snippet2", "dispose")); + + } + + /** + * Test that snippets are called after a call to loadModels() + * + * @throws ModelMultiException + */ + @Test + public void testSnippetCalledAfterLoadModels() throws ModelMultiException { + + // force model creation + testSnippetCalledAfterCreateModels(); + + // now do load. + ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); + + // Add snippets + TestTrace trace = new TestTrace(); + mngr.addModelSetSnippet(new FakeModelManagerSnippet(trace, "snippet1")); + mngr.addModelSetSnippet(new FakeModelManagerSnippet(trace, "snippet2")); + + // Do create + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("org.eclipse.papyrus.infra.core"); + IFile model1File = p.getFile("tmp/model1.ecore"); + mngr.loadModels(model1File); + + // Check calls + assertTrue("snippet1 called", trace.contains("snippet1", "start")); + assertTrue("snippet2 called", trace.contains("snippet2", "start")); + + // dispose + mngr.unload(); + // Check calls + assertTrue("snippet1 called", trace.contains("snippet1", "dispose")); + assertTrue("snippet2 called", trace.contains("snippet2", "dispose")); + + } + + /** + * Test {@link #createResources(String...)}. This is a test methods :-) + * + * @throws ModelMultiException + */ + @Test + public void testCreateResource() throws IOException, CoreException, ModelMultiException { + + String model1Key = "ecore"; + String model2Key = "genmodel"; + String model3Key = "uml"; + + // Create models + createResources("tmp/model1." + model1Key, "tmp/model1." + model2Key, "tmp/model1." + model3Key); + + // Check model creation + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(PLUGIN_PROJECT_NAME); + + IFile model1File = p.getFile("tmp/model1." + model1Key); + IFile model2File = p.getFile("tmp/model1." + model2Key); + IFile model3File = p.getFile("tmp/model1." + model3Key); + + assertTrue("modelFile exist", model1File.exists()); + assertTrue("modelFile exist", model2File.exists()); + assertTrue("modelFile exist", model3File.exists()); + } + + /** + * Test {@link ModelSet#importModels(ModelIdentifiers, IFile)} called after {@link ModelSet#createsModels(IFile)} . + * + * @throws ModelException + */ + @Test + public void testImportAfterCreate() throws IOException, CoreException, ModelException { + + String model1Key = "ecore"; + String model2Key = "genmodel"; + String model3Key = "uml"; + + // Create models + createResources("tmp/model1." + model1Key, "tmp/model1." + model2Key, "tmp/model1." + model3Key); + + // Now do registration + ModelSet mngr = houseKeeper.cleanUpLater(new ModelSet()); + + FakeModel model1 = new FakeModel(model1Key); + FakeModel model2 = new FakeModel(model2Key); + FakeModel model3 = new FakeModel(model3Key); + + mngr.registerModel(model1); + mngr.registerModel(model2); + mngr.registerModel(model3); + + + // Get an handle on one of the files + IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(PLUGIN_PROJECT_NAME); + IFile createdFile = p.getFile("tmp/model2." + model1Key); + + + // Try to create all models + mngr.createsModels(createdFile); + + assertNotNull("resource created", model1.getResource()); + assertNotNull("resource created", model2.getResource()); + assertNotNull("resource created", model3.getResource()); + + // Add something in the model + model1.getResource().getContents().add(EcoreFactory.eINSTANCE.createEPackage()); + assertEquals("model1 has changed", 1, model1.getResource().getContents().size()); + + // Try to import + IFile importFile = p.getFile("tmp/model1." + model1Key); + mngr.importModels(new ModelIdentifiers(model1Key, model2Key), importFile); + + assertNotNull("resource exist", model1.getResource()); + assertNotNull("resource exist", model2.getResource()); + assertNotNull("resource exist", model3.getResource()); + + assertEquals("model1 has changed", 0, model1.getResource().getContents().size()); + + + } + + /** + * Tests that model snippets are started if added to a model after it has loaded. + */ + @Test + public void testStartLateSnippet_bug481149() throws IOException, CoreException, ModelMultiException { + ModelSet modelSet = houseKeeper.cleanUpLater(new ModelSet()); + + String model1Key = "ecore"; + String model2Key = "genmodel"; + + FakeModel model1 = new FakeModel(model1Key); + FakeModel model2 = new FakeModel(model2Key); + + modelSet.registerModel(model1); + modelSet.registerModel(model2); + + class TestSnippet implements IModelSnippet { + Set active = Sets.newHashSet(); + + public void start(IModel startingModel) { + active.add(startingModel); + } + + public void dispose(IModel stoppingModel) { + active.remove(stoppingModel); + } + } + + TestSnippet earlySnippet = new TestSnippet(); + TestSnippet lateSnippet = new TestSnippet(); + + model1.addModelSnippet(earlySnippet); + model2.addModelSnippet(earlySnippet); + + modelSet.createModels(URI.createURI("bogus://test")); + + model1.addModelSnippet(lateSnippet); + model2.addModelSnippet(lateSnippet); + + assertThat(earlySnippet.active, is((Set) ImmutableSet. of(model1, model2))); + assertThat(lateSnippet.active, is((Set) ImmutableSet. of(model1, model2))); + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/NestingTransactionalCommandStackTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/NestingTransactionalCommandStackTest.java new file mode 100644 index 00000000000..bd747b966a0 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/NestingTransactionalCommandStackTest.java @@ -0,0 +1,514 @@ +/* + * 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.infra.core.resource; + +import static org.hamcrest.CoreMatchers.both; +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.CoreMatchers.sameInstance; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.fail; + +import java.net.URL; +import java.util.concurrent.Callable; + +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.CommandStack; +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.ENamedElement; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EcoreFactory; +import org.eclipse.emf.ecore.EcorePackage; +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.provider.ComposedAdapterFactory; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.TransactionalCommandStack; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.hamcrest.BaseMatcher; +import org.hamcrest.Description; +import org.hamcrest.Matcher; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import com.google.common.base.Objects; + + +/** + * Test suite for the {@link NestingTransactionalCommandStack} class. + */ +public class NestingTransactionalCommandStackTest extends AbstractPapyrusTest { + + // No API signatures but the most basic are required for nesting + private CommandStack fixture; + + private TransactionalEditingDomain domain; + + private ResourceSet rset; + + private EPackage testPackage; + + private EClass foo; + + public NestingTransactionalCommandStackTest() { + super(); + } + + // + // Test cases + // + + @Test + public void testCompleteUnnestedCommand() { + Callable createAttribute = createAttribute(); + + int oldFeatureCount = foo.getEStructuralFeatures().size(); + + // Create two attributes + EAttribute attr1 = execute(createAttribute); + EAttribute attr2 = execute(createAttribute); + assertThat(foo.getEStructuralFeatures().size(), is(oldFeatureCount + 2)); + assertThat(foo.getEStructuralFeatures(), hasItem(attr1)); + assertThat(foo.getEStructuralFeatures(), hasItem(attr2)); + + // Undo only undoes one of them + Command undone = undo(); + assertThat(foo.getEStructuralFeatures().size(), is(oldFeatureCount + 1)); + assertThat(foo.getEStructuralFeatures(), hasItem(attr1)); + assertThat(foo.getEStructuralFeatures(), not(hasItem(attr2))); + + // Redo is sane + Command redone = redo(); + assertThat(redone, sameInstance(undone)); + assertThat(foo.getEStructuralFeatures().size(), is(oldFeatureCount + 2)); + assertThat(foo.getEStructuralFeatures(), hasItem(attr1)); + assertThat(foo.getEStructuralFeatures(), hasItem(attr2)); + } + + @Test + public void testCancelUnnestedCommand() { + Callable createAttribute = createAttribute(2); + + int oldFeatureCount = foo.getEStructuralFeatures().size(); + + // Try to create two attributes (second one cancels) + EAttribute attr1 = execute(createAttribute); + EAttribute attr2 = execute(createAttribute); + assertThat(attr2, nullValue()); + assertThat(foo.getEStructuralFeatures().size(), is(oldFeatureCount + 1)); + assertThat(foo.getEStructuralFeatures(), hasItem(attr1)); + assertThat(foo.getEStructuralFeature("attribute2"), nullValue()); //$NON-NLS-1$ + + // Undo is sane + Command undone = undo(); + assertThat(foo.getEStructuralFeatures().size(), is(oldFeatureCount)); + assertThat(foo.getEStructuralFeatures(), not(hasItem(attr1))); + assertThat(foo.getEStructuralFeature("attribute2"), nullValue()); //$NON-NLS-1$ + + // Redo is sane + Command redone = redo(); + assertThat(redone, sameInstance(undone)); + assertThat(foo.getEStructuralFeatures().size(), is(oldFeatureCount + 1)); + assertThat(foo.getEStructuralFeatures(), hasItem(attr1)); + assertThat(foo.getEStructuralFeature("attribute2"), nullValue()); //$NON-NLS-1$ + } + + @Test + public void testCompleteNestedCommand() { + final int FEATURES = 2; + Callable createClass = createClass(FEATURES); + + int oldClassifierCount = testPackage.getEClassifiers().size(); + + EClass clas = execute(createClass); + assertThat(testPackage.getEClassifiers().size(), is(oldClassifierCount + 1)); + assertThat(testPackage.getEClassifiers(), hasItem(clas)); + assertThat(clas.getEStructuralFeatures().size(), is(FEATURES)); + assertThat(clas.getEStructuralFeature("attribute1"), notNullValue()); //$NON-NLS-1$ + assertThat(clas.getEStructuralFeature("attribute2"), notNullValue()); //$NON-NLS-1$ + + // Undo is sane and there is only one command to undo + Command undone = undo(); + assertThat(fixture.canUndo(), is(false)); + assertThat(testPackage.getEClassifiers().size(), is(oldClassifierCount)); + assertThat(testPackage.getEClassifiers(), not(hasItem(clas))); + + // Redo is sane + Command redone = redo(); + assertThat(redone, sameInstance(undone)); + assertThat(testPackage.getEClassifiers().size(), is(oldClassifierCount + 1)); + assertThat(testPackage.getEClassifiers(), hasItem(clas)); + assertThat(clas.getEStructuralFeatures().size(), is(FEATURES)); + assertThat(clas.getEStructuralFeature("attribute1"), notNullValue()); //$NON-NLS-1$ + assertThat(clas.getEStructuralFeature("attribute2"), notNullValue()); //$NON-NLS-1$ + } + + @Test + public void testCancelNestedCommand() { + final int FEATURES = 2; + Callable createClass = createClass(FEATURES, 2, FEATURES); + + int oldClassifierCount = testPackage.getEClassifiers().size(); + + // Try to create two classes (second one cancels) + EClass class1 = execute(createClass); + EClass class2 = execute(createClass); + assertThat(class2, nullValue()); + assertThat(testPackage.getEClassifiers().size(), is(oldClassifierCount + 1)); + assertThat(testPackage.getEClassifiers(), hasItem(class1)); + assertThat(class1.getEStructuralFeatures().size(), is(FEATURES)); + assertThat(class1.getEStructuralFeature("attribute1"), notNullValue()); //$NON-NLS-1$ + assertThat(class1.getEStructuralFeature("attribute2"), notNullValue()); //$NON-NLS-1$ + + // Undo is sane and there is only one command to undo + Command undone = undo(); + assertThat(fixture.canUndo(), is(false)); + assertThat(testPackage.getEClassifiers().size(), is(oldClassifierCount)); + assertThat(testPackage.getEClassifiers(), not(hasItem(class1))); + + // Redo is sane + Command redone = redo(); + assertThat(redone, sameInstance(undone)); + assertThat(testPackage.getEClassifiers().size(), is(oldClassifierCount + 1)); + assertThat(testPackage.getEClassifiers(), hasItem(class1)); + assertThat(class1.getEStructuralFeatures().size(), is(FEATURES)); + assertThat(class1.getEStructuralFeature("attribute1"), notNullValue()); //$NON-NLS-1$ + assertThat(class1.getEStructuralFeature("attribute2"), notNullValue()); //$NON-NLS-1$ + } + + @Test + public void testCompleteTripleNestedCommand() { + final int CLASSES = 2; + final int FEATURES = 2; + + Callable createPackage = createPackage(CLASSES, FEATURES); + + int oldPackageCount = testPackage.getESubpackages().size(); + + EPackage pkg = execute(createPackage); + assertThat(testPackage.getESubpackages().size(), is(oldPackageCount + 1)); + assertThat(testPackage.getESubpackages(), hasItem(pkg)); + assertThat(pkg.getEClassifiers().size(), is(CLASSES)); + assertThat(pkg.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class1")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + assertThat(pkg.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class2")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + + // Undo is sane and there is only one command to undo + Command undone = undo(); + assertThat(fixture.canUndo(), is(false)); + assertThat(testPackage.getESubpackages().size(), is(oldPackageCount)); + assertThat(testPackage.getESubpackages(), not(hasItem(pkg))); + assertThat(pkg.getName(), nullValue()); + assertThat(pkg.getEClassifiers().size(), is(0)); + assertThat(pkg.getEClassifiers().size(), is(0)); + + // Redo is sane + Command redone = redo(); + assertThat(redone, sameInstance(undone)); + assertThat(fixture.canRedo(), is(false)); + assertThat(testPackage.getESubpackages().size(), is(oldPackageCount + 1)); + assertThat(testPackage.getESubpackages(), hasItem(pkg)); + assertThat(pkg, named("package1")); //$NON-NLS-1$ + assertThat(pkg.getEClassifiers().size(), is(CLASSES)); + assertThat(pkg.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class1")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + assertThat(pkg.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class2")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + } + + @Test + public void testCancelTripleNestedCommand() { + final int CLASSES = 2; + final int FEATURES = 2; + + Callable createPackage = createPackage(CLASSES, FEATURES, 2, CLASSES, FEATURES); + + int oldPackageCount = testPackage.getESubpackages().size(); + + // Try to create two packages (second one cancels) + EPackage pkg1 = execute(createPackage); + EPackage pkg2 = execute(createPackage); + + // the first package is complete + assertThat(testPackage.getESubpackages().size(), is(oldPackageCount + 1)); + assertThat(testPackage.getESubpackages(), hasItem(pkg1)); + assertThat(pkg1, named("package1")); //$NON-NLS-1$ + assertThat(pkg1.getEClassifiers().size(), is(CLASSES)); + assertThat(pkg1.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class1")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + assertThat(pkg1.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class2")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + + // there is no second package + assertThat(pkg2, nullValue()); + + // Undo is sane and there is only one command to undo + Command undone = undo(); + assertThat(fixture.canUndo(), is(false)); + assertThat(testPackage.getESubpackages().size(), is(oldPackageCount)); + assertThat(testPackage.getESubpackages(), not(hasItem(pkg1))); + assertThat(pkg1.getName(), nullValue()); + assertThat(pkg1.getEClassifiers().size(), is(0)); + + // Redo is sane + Command redone = redo(); + assertThat(fixture.canRedo(), is(false)); + assertThat(redone, sameInstance(undone)); + assertThat(testPackage.getESubpackages().size(), is(oldPackageCount + 1)); + assertThat(testPackage.getESubpackages(), hasItem(pkg1)); + assertThat(pkg1, named("package1")); //$NON-NLS-1$ + assertThat(pkg1.getEClassifiers().size(), is(CLASSES)); + assertThat(pkg1.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class1")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + assertThat(pkg1.getEClassifiers(), hasItem(both(featureCount(FEATURES)).and(named("Class2")).and(hasFeature("attribute1")).and(hasFeature("attribute2")))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + } + + // + // Test framework + // + + @Before + public void createFixture() { + rset = new ResourceSetImpl(); + fixture = new NestingTransactionalCommandStack(); + AdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); + domain = new TransactionalEditingDomainImpl(adapterFactory, (TransactionalCommandStack)fixture, rset); + + URL testModelURL = getClass().getResource("Bug402525.ecore"); //$NON-NLS-1$ + Resource testModel = rset.getResource(URI.createURI(testModelURL.toExternalForm(), true), true); + testPackage = (EPackage)testModel.getContents().get(0); + foo = (EClass)testPackage.getEClassifier("Foo"); //$NON-NLS-1$ + } + + @After + public void destroyFixture() { + // This disposes the command stack for us + domain.dispose(); + domain = null; + fixture = null; + + dispose(rset); + rset = null; + } + + void dispose(ResourceSet rset) { + for(Resource next : rset.getResources()) { + next.unload(); + next.eAdapters().clear(); + } + + rset.getResources().clear(); + rset.eAdapters().clear(); + } + + V execute(final Callable operation) { + class TestCommand extends RecordingCommand { + + V result; + + TestCommand() { + super(domain); + } + + @Override + protected void doExecute() { + try { + result = operation.call(); + } catch (OperationCanceledException e) { + // Pass it on + throw e; + } catch (Exception e) { + e.printStackTrace(); + fail("Uncaught exception in operation: " + e.getLocalizedMessage()); //$NON-NLS-1$ + } + } + } + + TestCommand command = new TestCommand(); + fixture.execute(command); + return command.result; + } + + Command undo() { + assertThat("Cannot undo", fixture.canUndo()); //$NON-NLS-1$ + Command result = fixture.getUndoCommand(); + fixture.undo(); + return result; + } + + Command redo() { + assertThat("Cannot redo", fixture.canRedo()); //$NON-NLS-1$ + Command result = fixture.getRedoCommand(); + fixture.redo(); + return result; + } + + Callable createAttribute() { + return createAttribute(0); + } + + Callable createAttribute(int cancelOn) { + return createAttribute(foo, cancelOn); + } + + Callable createAttribute(final EClass owner, final int cancelOn) { + return new Callable() { + + int i = 0; + + public EAttribute call() throws Exception { + String name = nextName(); + + EAttribute attr = EcoreFactory.eINSTANCE.createEAttribute(); + owner.getEStructuralFeatures().add(attr); + attr.setName(name); + attr.setEType(EcorePackage.Literals.ESTRING); + + checkCancel(); + + return attr; + } + + private String nextName() { + i = i + 1; + return "attribute" + i; //$NON-NLS-1$ + } + + private void checkCancel() { + if(i == cancelOn) { + throw new OperationCanceledException(); + } + } + }; + } + + Callable createClass(int attributes) { + return createClass(attributes, 0, 0); + } + + Callable createClass(int attributes, int cancelOn, int cancelAttributesOn) { + return createClass(testPackage, attributes, cancelOn, cancelAttributesOn); + } + + Callable createClass(final EPackage owner, final int attributes, final int cancelOn, final int cancelAttributesOn) { + return new Callable() { + + int i = 0; + + public EClass call() throws Exception { + String name = nextName(); + + EClass clas = EcoreFactory.eINSTANCE.createEClass(); + owner.getEClassifiers().add(clas); + clas.setName(name); + + Callable createAttribute = createAttribute(clas, checkCancelAttributes()); + for(int i = 0; i < attributes; i++) { + // Nested command + execute(createAttribute); + } + + return clas; + } + + private String nextName() { + i = i + 1; + return "Class" + i; //$NON-NLS-1$ + } + + private int checkCancelAttributes() { + return (i == cancelOn) ? cancelAttributesOn : 0; + } + }; + } + + Callable createPackage(int classes, int attributes) { + return createPackage(classes, attributes, 0, 0, 0); + } + + Callable createPackage(final int classes, final int attributes, final int cancelOn, final int cancelClassesOn, final int cancelAttributesOn) { + return new Callable() { + + int i = 0; + + public EPackage call() throws Exception { + String name = nextName(); + + EPackage pkg = EcoreFactory.eINSTANCE.createEPackage(); + testPackage.getESubpackages().add(pkg); + pkg.setName(name); + + Callable createClass = createClass(pkg, attributes, checkCancelClasses(), cancelAttributesOn); + for(int i = 0; i < classes; i++) { + // Nested command + execute(createClass); + } + + return pkg; + } + + private String nextName() { + i = i + 1; + return "package" + i; //$NON-NLS-1$ + } + + private int checkCancelClasses() { + return (i == cancelOn) ? cancelClassesOn : 0; + } + }; + } + + Matcher named(final String name) { + return new BaseMatcher() { + + public void describeTo(Description desc) { + desc.appendText("is named \"").appendValue(name).appendText("\""); //$NON-NLS-1$ //$NON-NLS-2$ + } + + public boolean matches(Object o) { + return (o instanceof ENamedElement) && Objects.equal(((ENamedElement)o).getName(), name); + } + }; + } + + Matcher featureCount(final int count) { + return new BaseMatcher() { + + public void describeTo(Description desc) { + desc.appendText("has ").appendValue(count).appendText(" features"); //$NON-NLS-1$ //$NON-NLS-2$ + } + + public boolean matches(Object o) { + return (o instanceof EClass) && (((EClass)o).getEStructuralFeatures().size() == count); + } + }; + } + + Matcher hasFeature(final String name) { + return new BaseMatcher() { + + public void describeTo(Description desc) { + desc.appendText("has a \"").appendValue(name).appendText("\" feature"); //$NON-NLS-1$ //$NON-NLS-2$ + } + + public boolean matches(Object o) { + return (o instanceof EClass) && (((EClass)o).getEStructuralFeature(name) != null); + } + }; + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTest.java new file mode 100644 index 00000000000..72db79ae738 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTest.java @@ -0,0 +1,122 @@ +/* + * 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 482949 + * + */ +package org.eclipse.papyrus.infra.core.resource; + +import static org.junit.Assert.fail; + +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.papyrus.junit.utils.rules.HouseKeeper; + + +/** + * Test suite for the {@link ResourceAdapter} class. + */ +public class ResourceAdapterTest extends AbstractResourceAdapterTest { + + public ResourceAdapterTest() { + super(); + } + + // + // Test framework + // + + @Override + protected ResourceSet createTarget(HouseKeeper keeper) { + return keeper.createResourceSet(); + } + + @Override + protected ResourceSet getResourceSet(ResourceSet target) { + return target; + } + + @Override + protected void execute(Runnable command) { + command.run(); + } + + @Override + protected void safeExecute(RunnableWithException command) { + try { + command.run(); + } catch (Exception e) { + e.printStackTrace(); + fail("Command execution failed: " + e.getMessage()); + } + } + + @Override + protected AbstractResourceAdapterTest.Fixture doCreateFixture() { + return new MyFixture(); + } + + class MyFixture extends Fixture { + + @Override + protected void doInstall(ResourceAdapter adapter, ResourceSet target) { + if (!target.eAdapters().contains(adapter)) { + target.eAdapters().add(adapter); + } + } + + @Override + protected void doUninstall(ResourceAdapter adapter, ResourceSet target) { + target.eAdapters().remove(adapter); + } + + @Override + protected ResourceAdapter createAdapter() { + return new ResourceAdapter() { + @Override + protected void handleResourceAdded(Resource resource) { + MyFixture.this.handleResourceAdded(resource); + } + + @Override + protected void handleResourceRemoved(Resource resource) { + MyFixture.this.handleResourceRemoved(resource); + } + + @Override + protected void handleResourceLoaded(Resource resource) { + MyFixture.this.handleResourceLoaded(resource); + } + + @Override + protected void handleResourceUnloaded(Resource resource) { + MyFixture.this.handleResourceUnloaded(resource); + } + + @Override + protected void handleResourceURI(Resource resource, URI oldURI, URI newURI) { + MyFixture.this.handleResourceURI(resource, oldURI, newURI); + } + + @Override + protected void handleRootAdded(Resource resource, EObject root) { + MyFixture.this.handleRootAdded(resource, root); + } + + @Override + protected void handleRootRemoved(Resource resource, EObject root) { + MyFixture.this.handleRootRemoved(resource, root); + } + }; + } + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTransactionalTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTransactionalTest.java new file mode 100644 index 00000000000..97e6cd3a857 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/ResourceAdapterTransactionalTest.java @@ -0,0 +1,138 @@ +/* + * 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.infra.core.resource; + +import org.eclipse.emf.common.util.URI; +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.transaction.RecordingCommand; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; + + +/** + * Test suite for the {@link ResourceAdapter.Transactional} class. + */ +public class ResourceAdapterTransactionalTest extends AbstractResourceAdapterTest { + + public ResourceAdapterTransactionalTest() { + super(); + } + + // + // Test framework + // + + @Override + protected boolean isTransactional() { + return true; + } + + @Override + protected TransactionalEditingDomain createTarget(HouseKeeper keeper) { + return keeper.createSimpleEditingDomain(); + } + + @Override + protected ResourceSet getResourceSet(TransactionalEditingDomain target) { + return target.getResourceSet(); + } + + @Override + protected void execute(Runnable command) { + TransactionalEditingDomain domain = getTarget(); + domain.getCommandStack().execute(new RecordingCommand(domain, "Test") { + + @Override + protected void doExecute() { + command.run(); + } + }); + } + + @Override + protected void safeExecute(RunnableWithException command) { + TransactionalEditingDomain domain = getTarget(); + domain.getCommandStack().execute(new RecordingCommand(domain, "Test") { + + @Override + protected void doExecute() { + try { + command.run(); + } catch (Exception e) { + throw new WrappedException(e); + } + } + }); + } + + @Override + protected Fixture doCreateFixture() { + return new MyFixture(); + } + + class MyFixture extends Fixture { + + @Override + protected void doInstall(ResourceAdapter.Transactional adapter, TransactionalEditingDomain target) { + adapter.install(target); + } + + @Override + protected void doUninstall(ResourceAdapter.Transactional adapter, TransactionalEditingDomain target) { + adapter.uninstall(target); + } + + @Override + protected ResourceAdapter.Transactional createAdapter() { + return new ResourceAdapter.Transactional() { + @Override + protected void handleResourceAdded(Resource resource) { + MyFixture.this.handleResourceAdded(resource); + } + + @Override + protected void handleResourceRemoved(Resource resource) { + MyFixture.this.handleResourceRemoved(resource); + } + + @Override + protected void handleResourceLoaded(Resource resource) { + MyFixture.this.handleResourceLoaded(resource); + } + + @Override + protected void handleResourceUnloaded(Resource resource) { + MyFixture.this.handleResourceUnloaded(resource); + } + + @Override + protected void handleResourceURI(Resource resource, URI oldURI, URI newURI) { + MyFixture.this.handleResourceURI(resource, oldURI, newURI); + } + + @Override + protected void handleRootAdded(Resource resource, EObject root) { + MyFixture.this.handleRootAdded(resource, root); + } + + @Override + protected void handleRootRemoved(Resource resource, EObject root) { + MyFixture.this.handleRootRemoved(resource, root); + } + }; + } + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/TestTrace.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/TestTrace.java new file mode 100644 index 00000000000..c41194fccf5 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/resource/TestTrace.java @@ -0,0 +1,153 @@ +/** + * + */ +package org.eclipse.papyrus.infra.core.resource; + +import java.util.ArrayList; +import java.util.List; + + +/** + * A class used to record traces for tests + * + * @author cedric dumoulin + * + */ +public class TestTrace { + + public Listtraces = new ArrayList(); + + /** + * Record a new trace. + * @param trace + */ + public void addTrace(String trace) { + addTrace(null, trace, null); + } + + /** + * Record a new trace. + * @param trace + */ + public void addTrace(String name, String trace) { + addTrace(name, trace, null); + } + + /** + * Record a new trace. + * @param trace + */ + public void addTrace(String name, String trace, Object value) { + traces.add(new TraceRecord( name, trace, value)); + } + + /** + * Return true if the trace contains the specified events. + * @return + */ + public boolean contains( String name, String trace) { + + return indexOfNameTrace(name, trace) >= 0; + } + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public int indexOf(String name, String trace, Object value) { + + for (int i = 0; i < traces.size(); i++) { + TraceRecord record = traces.get(i); + + if( name.equals(record.name) && trace.equals(record.trace) ) + return i; + } + + return -1; + } + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public int indexOfNameTrace(String name, String trace) { + + for (int i = 0; i < traces.size(); i++) { + TraceRecord record = traces.get(i); + + if( name.equals(record.name) && trace.equals(record.trace) ) + return i; + } + + return -1; + } + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public int indexOfTrace(String trace) { + + for (int i = 0; i < traces.size(); i++) { + TraceRecord record = traces.get(i); + + if( trace.equals(record.trace) ) + return i; + } + + return -1; + } + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public int indexOfName(String name) { + + for (int i = 0; i < traces.size(); i++) { + TraceRecord record = traces.get(i); + + if( name.equals(record.name) ) + return i; + } + + return -1; + } + + /** + * Reset the trace. + */ + public void reset() { + traces.clear(); + } + + + /** + * @return the traces + */ + public List getTraces() { + return traces; + } + + /** + * A Record of the trace. + */ + public class TraceRecord { + public String name; + public String trace; + public Object value; + /** + * Constructor. + * + * @param name + * @param trace + * @param value + */ + public TraceRecord(String name, String trace, Object value) { + this.name = name; + this.trace = trace; + this.value = value; + } + + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ComposedServiceTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ComposedServiceTest.java new file mode 100644 index 00000000000..7492d60c2e4 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ComposedServiceTest.java @@ -0,0 +1,156 @@ +/***************************************************************************** + * Copyright (c) 2010, 2016 LIFL, 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: + * LIFL - Initial API and implementation + * Christian W. Damus - bug 488791 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.services; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.List; + +import org.eclipse.papyrus.infra.core.services.ServicesRegistryTest.TestServiceDescriptor; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + + +public class ComposedServiceTest extends AbstractPapyrusTest { + + private FakeComposedService masterService; + + + @Before + public void setUp() throws Exception { + masterService = new FakeComposedService(); + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testAddServicePart() { + FakeComposedServicePartA partA = new FakeComposedServicePartA(); + FakeComposedServicePartB partB = new FakeComposedServicePartB(); + + masterService.addServicePart(partA); + masterService.addServicePart(partB); + + List addedParts = masterService.getRegisteredServices(); + + assertTrue("service contains partA", addedParts.contains(partA)); + assertTrue("service contains partB", addedParts.contains(partB)); + } + + @Test + public void testRemoveServicePart() { + FakeComposedServicePartA partA = new FakeComposedServicePartA(); + FakeComposedServicePartB partB = new FakeComposedServicePartB(); + + masterService.addServicePart(partA); + masterService.addServicePart(partB); + + List addedParts = masterService.getRegisteredServices(); + + assertTrue("service contains partA", addedParts.contains(partA)); + assertTrue("service contains partB", addedParts.contains(partB)); + + masterService.removeServicePart(partA); + assertFalse("service contains partA", addedParts.contains(partA)); + assertTrue("service contains partB", addedParts.contains(partB)); + + } + + /** + * Test that the parts registered to the ServiceRegistry are automaticly + * registered to there associated main service when registry is started. + * + * @throws ServiceException + */ + @Test + public void testPartAutomaticRegistration() throws ServiceException { + + ServicesRegistry serviceRegistry = new ServicesRegistry(); + + // Register services + serviceRegistry.add(new ComposedServiceDescriptor()); + serviceRegistry.add(new ServicePartADescriptor()); + serviceRegistry.add(new ServicePartBDescriptor()); + + // start registry + serviceRegistry.startRegistry(); + + // Check if connected + FakeComposedService masterService = serviceRegistry.getService(FakeComposedService.class); + FakeComposedServicePartA partA = serviceRegistry.getService(FakeComposedServicePartA.class); + FakeComposedServicePartB partB = serviceRegistry.getService(FakeComposedServicePartB.class); + + List addedParts = masterService.getRegisteredServices(); + + assertNotNull("master service found", masterService); + assertTrue("service contains partA", addedParts.contains(partA)); + assertTrue("service contains partB", addedParts.contains(partB)); + + + } + + + /* ***************************** */ + + /** + * A descriptor + * + * @author dumoulin + * + */ + public class ServicePartADescriptor extends TestServiceDescriptor { + + + public ServicePartADescriptor() { + super(FakeComposedServicePartA.class, FakeComposedServicePartA.class.getName(), ServiceStartKind.STARTUP, 1); + } + } + + + /** + * A descriptor + * + * @author dumoulin + * + */ + public class ServicePartBDescriptor extends TestServiceDescriptor { + + + public ServicePartBDescriptor() { + super(FakeComposedServicePartB.class, FakeComposedServicePartB.class.getName(), ServiceStartKind.STARTUP, 1); + } + } + + /** + * A descriptor + * + * @author dumoulin + * + */ + public class ComposedServiceDescriptor extends TestServiceDescriptor { + + + public ComposedServiceDescriptor() { + super(FakeComposedService.class, FakeComposedService.class.getName(), ServiceStartKind.STARTUP, 1); + } + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedService.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedService.java new file mode 100644 index 00000000000..95785fc6f26 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedService.java @@ -0,0 +1,46 @@ +/** + * + */ +package org.eclipse.papyrus.infra.core.services; + + + + +/** + * A fake composed service for testing purpose. + * + * @author cedric dumoulin + * + */ +public class FakeComposedService extends ComposedService { + + /** + * Call the same method on all associated service parts. + */ + public void walkService() { + + for( FakeComposedServicePart servicePart : serviceParts ) + { + servicePart.walkService(); + } + } + + @Override + public void init(ServicesRegistry servicesRegistry) throws ServiceException { + // TODO Auto-generated method stub + + } + + @Override + public void startService() throws ServiceException { + // TODO Auto-generated method stub + + } + + @Override + public void disposeService() throws ServiceException { + // TODO Auto-generated method stub + + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePart.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePart.java new file mode 100644 index 00000000000..aaba874576a --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePart.java @@ -0,0 +1,27 @@ +/** + * + */ +package org.eclipse.papyrus.infra.core.services; + + + +/** + * A fake composed service part for testing purpose. + * @author cedric dumoulin + * + */ +public class FakeComposedServicePart extends ComposedServicePart { + + + public FakeComposedServicePart() { + super(FakeComposedService.class); + } + + /** + * A common method. + */ + public void walkService() { + // TODO Auto-generated method stub + + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartA.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartA.java new file mode 100644 index 00000000000..63387d8330c --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartA.java @@ -0,0 +1,13 @@ +/** + * + */ +package org.eclipse.papyrus.infra.core.services; + + +/** + * @author dumoulin + * + */ +public class FakeComposedServicePartA extends FakeComposedServicePart { + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartB.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartB.java new file mode 100644 index 00000000000..ae78757b188 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeComposedServicePartB.java @@ -0,0 +1,13 @@ +/** + * + */ +package org.eclipse.papyrus.infra.core.services; + + +/** + * @author dumoulin + * + */ +public class FakeComposedServicePartB extends FakeComposedServicePart { + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeService.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeService.java new file mode 100644 index 00000000000..2a4f1111018 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeService.java @@ -0,0 +1,75 @@ +package org.eclipse.papyrus.infra.core.services; + + + +/** + * Fake service for testing purpose. + * + * @author cedric dumoulin + * + */ +public class FakeService implements IService { + + + static public TestTrace trace = new TestTrace(); + + static int count = 0; + + public String name = "name" + count++; + + + /** + * + * Constructor. + * + */ + public FakeService() { + trace.addTrace(name, "create"); + } + + /** + * Constructor. + * + * @param name + */ + public FakeService(String name) { + this.name = name; + trace.addTrace(name, "create"); + } + + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the trace + */ + static public TestTrace getTrace() { + return trace; + } + + + /** + * @param trace the trace to set + */ + public void setTrace(TestTrace trace) { + this.trace = trace; + } + + public void init(ServicesRegistry servicesRegistry) { + trace.addTrace(name, "init", servicesRegistry); + } + + public void startService() { + trace.addTrace(name, "start"); + } + + public void disposeService() { + trace.addTrace(name, "dispose"); + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeServiceFactory.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeServiceFactory.java new file mode 100644 index 00000000000..8f6190c8ac5 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeServiceFactory.java @@ -0,0 +1,66 @@ +package org.eclipse.papyrus.infra.core.services; + + + +/** + * Fake service factory for testing purpose. + * + * @author cedric dumoulin + * + */ +public class FakeServiceFactory extends FakeService implements IServiceFactory { + + + /** + * + * Constructor. + * + */ + public FakeServiceFactory() { + + super( "factoryName" + count++ ); + } + + /** + * Constructor. + * + * @param name + */ + public FakeServiceFactory(String name) { + super(name); + } + + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * Create the service + * @see org.eclipse.papyrus.infra.core.services.IServiceFactory#createServiceInstance() + * + * @return + */ + public Object createServiceInstance() { + trace.addTrace(getName(), "createInstance"); + return new FakeCreatedService(); + } + + /** + * Pseudo service created by the factory. + * @author dumoulin + * + */ + public class FakeCreatedService { + + /** + * @return the name + */ + public String getName() { + return name; + } + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeWithRequiredServiceFactory.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeWithRequiredServiceFactory.java new file mode 100644 index 00000000000..eb3fda0cfee --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/FakeWithRequiredServiceFactory.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.infra.core.services; + + + +/** + * Fake service factory for testing purpose. + * This service require the + * + * @author cedric dumoulin + * + */ +public class FakeWithRequiredServiceFactory extends FakeServiceFactory implements IServiceFactory { + + + /** + * + * Constructor. + * + */ + public FakeWithRequiredServiceFactory() { + + super( "factoryName" + count++ ); + } + + /** + * Constructor. + * + * @param name + */ + public FakeWithRequiredServiceFactory(String name) { + super(name); + } + + + /** + * + * @see org.eclipse.papyrus.infra.core.services.FakeService#init(org.eclipse.papyrus.infra.core.services.ServicesRegistry) + * + * @param servicesRegistry + */ + @Override + public void init(ServicesRegistry servicesRegistry) { + + trace.addTrace(name, "init"); + Object foundService = null; + try { + foundService = servicesRegistry.getService("C"); + } catch (ServiceException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + trace.addTrace(name, "initEnd", foundService); + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA.java new file mode 100644 index 00000000000..183587aa859 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA.java @@ -0,0 +1,49 @@ +package org.eclipse.papyrus.infra.core.services; + +import java.util.ArrayList; +import java.util.List; + +public class ServiceA implements IService { + + public enum TraceKind { + init, start, dispose + }; + + static List trace = new ArrayList(); + + static List nametrace = new ArrayList(); + + + + static public TraceKind getEvent(int index) { + return trace.get(index); + } + + static public String getTraceName(int index) { + return nametrace.get(index); + } + + static public void resetTrace() { + trace.clear(); + nametrace.clear(); + } + + public void init(ServicesRegistry servicesRegistry) { + trace.add(TraceKind.init); + nametrace.add(this.getClass().getSimpleName()); + + } + + public void startService() { + trace.add(TraceKind.start); + nametrace.add(this.getClass().getSimpleName()); + + } + + public void disposeService() { + trace.add(TraceKind.dispose); + nametrace.add(this.getClass().getSimpleName()); + + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA10.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA10.java new file mode 100644 index 00000000000..6865b03163f --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceA10.java @@ -0,0 +1,6 @@ +package org.eclipse.papyrus.infra.core.services; + + +public class ServiceA10 extends ServiceA { + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceB.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceB.java new file mode 100644 index 00000000000..df2f6faaaff --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceB.java @@ -0,0 +1,6 @@ +package org.eclipse.papyrus.infra.core.services; + + +public class ServiceB extends ServiceA { + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceC.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceC.java new file mode 100644 index 00000000000..ac1e4779652 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServiceC.java @@ -0,0 +1,6 @@ +package org.eclipse.papyrus.infra.core.services; + + +public class ServiceC extends ServiceA { + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicePojoA.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicePojoA.java new file mode 100644 index 00000000000..ae6c9690eae --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicePojoA.java @@ -0,0 +1,6 @@ +package org.eclipse.papyrus.infra.core.services; + + +public class ServicePojoA extends ServiceA { + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicesRegistryTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicesRegistryTest.java new file mode 100644 index 00000000000..0b8e1ce035e --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/ServicesRegistryTest.java @@ -0,0 +1,846 @@ +/***************************************************************************** + * Copyright (c) 2010, 2016 LIFL, 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: + * LIFL - Initial API and implementation + * Christian W. Damus - bugs 488791, 488558 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.services; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.papyrus.infra.core.services.FakeServiceFactory.FakeCreatedService; +import org.eclipse.papyrus.infra.core.services.ServiceA.TraceKind; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.junit.Before; +import org.junit.Test; + + +/** + * @author dumoulin + * + */ +public class ServicesRegistryTest extends AbstractPapyrusTest { + + /** The registry to test */ + ServicesRegistry servicesRegistry; + + ServiceDescriptor serviceADesc = new LazyServiceADescriptor(); + + ServiceDescriptor serviceA10Desc = new LazyServiceA10Descriptor(); + + ServiceDescriptor serviceBDesc = new LazyServiceBDescriptor(); + + ServiceDescriptor serviceCDesc = new ServiceCDescriptor(); + + ServiceDescriptor servicePojoADesc = new LazyServicePojoADescriptor(); + + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + servicesRegistry = new ServicesRegistry(); + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.services.ServicesRegistry#add(org.eclipse.papyrus.infra.core.services.ServiceDescriptor)} + * . + * + * @throws ServiceMultiException + */ + @Test + public void testAdd() throws ServiceMultiException { + + servicesRegistry.add(serviceADesc); + servicesRegistry.add(serviceBDesc); + servicesRegistry.add(serviceCDesc); + servicesRegistry.add(servicePojoADesc); + + // Test entries creation + // try { + // assertFalse("serviceA stopped", servicesRegistry.isStarted(serviceADesc.getKey())); + // assertFalse("serviceB stopped", servicesRegistry.isStarted(serviceBDesc.getKey())); + // assertFalse("serviceC stopped", servicesRegistry.isStarted(serviceCDesc.getKey())); + // assertFalse("servicePojoA stopped", servicesRegistry.isStarted(servicePojoADesc.getKey())); + // } catch (ServiceNotFoundException e) { + // fail("Service should exist." + e.getMessage()); + // } + + // Test startup + servicesRegistry.startRegistry(); + + // Test always started + try { + assertFalse("serviceA stopped", servicesRegistry.isStarted(serviceADesc.getKey())); + assertFalse("serviceB stopped", servicesRegistry.isStarted(serviceBDesc.getKey())); + assertEquals("serviceC state", ServiceState.started, servicesRegistry.serviceState(serviceCDesc.getKey())); + assertTrue("serviceC started", servicesRegistry.isStarted(serviceCDesc.getKey())); + assertFalse("servicePojoA stopped", servicesRegistry.isStarted(servicePojoADesc.getKey())); + } catch (ServiceNotFoundException e) { + fail("Service should exist."); + } + + + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.services.ServicesRegistry#getService(java.lang.Object)}. + * + * @throws ServiceException + */ + @Test + public void testGetService() throws ServiceException { + servicesRegistry.add(serviceADesc); + servicesRegistry.add(serviceBDesc); + servicesRegistry.add(serviceCDesc); + servicesRegistry.add(servicePojoADesc); + + + servicesRegistry.startRegistry(); + + // Test lazy service + Object serviceA = servicesRegistry.getService(serviceADesc.getKey()); + assertNotNull("service created", serviceA); + assertEquals("right class", ServiceA.class, serviceA.getClass()); + + Object serviceA2 = servicesRegistry.getService(serviceADesc.getKey()); + assertEquals("Second retrieve get the same service", serviceA, serviceA2); + + // test startup service + Object serviceC = servicesRegistry.getService(serviceCDesc.getKey()); + assertNotNull("service created", serviceC); + assertEquals("right class", ServiceC.class, serviceC.getClass()); + + Object serviceC2 = servicesRegistry.getService(serviceCDesc.getKey()); + assertEquals("Second retrieve get the same service", serviceC, serviceC2); + + // test pojo service + Object servicePojo = servicesRegistry.getService(servicePojoADesc.getKey()); + assertNotNull("service created", servicePojo); + assertEquals("right class", ServicePojoA.class, servicePojo.getClass()); + + Object servicePojo2 = servicesRegistry.getService(servicePojoADesc.getKey()); + assertEquals("Second retrieve get the same service", servicePojo, servicePojo2); + + + } + + /** + * Test method for {@link org.eclipse.papyrus.infra.core.services.ServicesRegistry#getService(java.lang.Object)}. + * + * @throws ServiceException + */ + @Test + public void testGetServiceByClass() throws ServiceException { + servicesRegistry.add(serviceADesc); + servicesRegistry.add(serviceBDesc); + servicesRegistry.add(serviceCDesc); + servicesRegistry.add(servicePojoADesc); + + + servicesRegistry.startRegistry(); + + // Test lazy service + ServiceA serviceA = servicesRegistry.getService(ServiceA.class); + assertNotNull("service created", serviceA); + assertEquals("right class", ServiceA.class, serviceA.getClass()); + + ServiceA serviceA2 = servicesRegistry.getService(ServiceA.class); + assertEquals("Second retrieve get the same service", serviceA, serviceA2); + + // test startup service + ServiceC serviceC = servicesRegistry.getService(ServiceC.class); + assertNotNull("service created", serviceC); + assertEquals("right class", ServiceC.class, serviceC.getClass()); + + // test pojo service + ServicePojoA servicePojo = servicesRegistry.getService(ServicePojoA.class); + assertNotNull("service created", servicePojo); + assertEquals("right class", ServicePojoA.class, servicePojo.getClass()); + + Object servicePojo2 = servicesRegistry.getService(ServicePojoA.class); + assertEquals("Second retrieve get the same service", servicePojo, servicePojo2); + + + } + + /** + * Try to register 2 services under the same name, but with different priorities. + * + * @throws ServiceException + */ + @Test + public void testPriority() throws ServiceException { + servicesRegistry.add(serviceADesc); + servicesRegistry.add(serviceA10Desc); + servicesRegistry.add(serviceBDesc); + + // Test creation + // try { + // assertFalse("serviceA stopped", servicesRegistry.isStarted(serviceADesc.getKey())); + // assertFalse("serviceB stopped", servicesRegistry.isStarted(serviceBDesc.getKey())); + // } catch (ServiceNotFoundException e) { + // fail("Service should exist."); + // } + + servicesRegistry.startRegistry(); + + Object serviceA = servicesRegistry.getService(serviceADesc.getKey()); + + assertNotNull("Service created", serviceA); + assertEquals("right class", ServiceA10.class, serviceA.getClass()); + + + } + + /** + * Test add for a direct instance of service. + * + * @throws ServiceException + */ + @Test + public void testAddDirectInstance() throws ServiceException { + IService instanciatedService = new ServiceA(); + String key = instanciatedService.getClass().getName(); + + servicesRegistry.add(key, 1, instanciatedService); + + servicesRegistry.add(serviceCDesc); + servicesRegistry.add(serviceBDesc); + + servicesRegistry.startRegistry(); + + Object serviceA = servicesRegistry.getService(key); + + assertNotNull("Service created", serviceA); + assertEquals("right object", instanciatedService, serviceA); + assertEquals("right class", ServiceA.class, serviceA.getClass()); + + + } + + /** + * Test life cycle for directly registered services + * + * @throws ServiceException + */ + @Test + public void testCallsOrder() throws ServiceException { + // Register services as STARTUP ! + servicesRegistry.add(ServiceA.class, 1, new ServiceA()); + // Lazy - generate no trace + servicesRegistry.add(ServiceB.class, 1, new ServiceB(), ServiceStartKind.LAZY); + servicesRegistry.add(ServiceC.class, 1, new ServiceC()); + servicesRegistry.add(ServicePojoA.class, 1, new ServicePojoA()); + + + ServiceA.resetTrace(); + servicesRegistry.startRegistry(); + + // Check orders + // + int i = 0; + assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); + assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); + assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); + // assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); + + assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); + assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); + assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); + // assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); + + // Now, start lazy service + ServiceB service = servicesRegistry.getService(ServiceB.class); + assertNotNull("service found", service); + assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); + assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); + + + // Check dispose + servicesRegistry.disposeRegistry(); + assertEquals("service", TraceKind.dispose, ServiceA.getEvent(i++)); + assertEquals("service", TraceKind.dispose, ServiceA.getEvent(i++)); + assertEquals("service", TraceKind.dispose, ServiceA.getEvent(i++)); + // assertEquals("service", TraceKind.dispose, ServiceA.getEvent(i++)); + + // + } + + /** + * Test life cycle for services registered wih descriptors + * + * @throws ServiceException + */ + @Test + public void testCallsOrderForDescriptors() throws ServiceException { + // Register services as STARTUP ! + // Lazy - generate no trace + servicesRegistry.add(new LazyServiceBDescriptor()); + servicesRegistry.add(new ServiceCDescriptor()); + + + ServiceA.resetTrace(); + servicesRegistry.startRegistry(); + + // Check orders + // + int i = 0; + assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); + // assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); + + assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); + // assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); + + // Now, start lazy service + ServiceB service = (ServiceB) servicesRegistry.getService(ServiceB.class.getName()); + assertNotNull("service found", service); + assertEquals("service", TraceKind.init, ServiceA.getEvent(i++)); + assertEquals("service", TraceKind.start, ServiceA.getEvent(i++)); + + + // Check dispose + servicesRegistry.disposeRegistry(); + assertEquals("service", TraceKind.dispose, ServiceA.getEvent(i++)); + assertEquals("service", TraceKind.dispose, ServiceA.getEvent(i++)); + // assertEquals("service", TraceKind.dispose, ServiceA.getEvent(i++)); + + // + } + + /** + * Test the start order for services of type Start and Service + * + * @throws ServiceException + */ + @Test + public void testStartDependantOrder() throws ServiceException { + + String A = "A"; + String B = "B"; + String C = "C"; + String D = "D"; + String E = "E"; + // String F = "F"; + + // Create services E --> D --> C --> B --> A + FakeService.getTrace().reset(); + + servicesRegistry.add(new ServiceDesc(E, ServiceStartKind.STARTUP, Arrays.asList(D))); + servicesRegistry.add(new ServiceDesc(D, ServiceStartKind.STARTUP, Arrays.asList(C))); + servicesRegistry.add(new ServiceDesc(C, ServiceStartKind.STARTUP, Arrays.asList(B))); + servicesRegistry.add(new ServiceDesc(B, ServiceStartKind.STARTUP, Arrays.asList(A))); + servicesRegistry.add(new ServiceDesc(A, ServiceStartKind.STARTUP)); + // servicesRegistry.add( new ServiceDesc( F, ServiceStartKind.STARTUP, Arrays.asList(E) )); + + // Start services + servicesRegistry.startRegistry(); + + // check services + assertTrue("service started", servicesRegistry.isStarted(A)); + assertTrue("service started", servicesRegistry.isStarted(B)); + assertNotSame("services are different", servicesRegistry.getService(A), servicesRegistry.getService(B)); + + // Get names of created services + String nameA = ((FakeService) servicesRegistry.getService(A)).getName(); + String nameB = ((FakeService) servicesRegistry.getService(B)).getName(); + String nameC = ((FakeService) servicesRegistry.getService(C)).getName(); + String nameD = ((FakeService) servicesRegistry.getService(D)).getName(); + String nameE = ((FakeService) servicesRegistry.getService(E)).getName(); + // String nameF = ((FakeService)servicesRegistry.getService(F)).getName(); + + + // check order (E and F order are not guaranteed) + // order should be A, B, C, D, E + TestTrace trace = FakeService.getTrace(); + int i = 0; + // assertEquals("order", nameF + ",create", trace.getNameTrace(i++)); + assertEquals("order", nameA + ",create", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",create", trace.getNameTrace(i++)); + assertEquals("order", nameC + ",create", trace.getNameTrace(i++)); + assertEquals("order", nameD + ",create", trace.getNameTrace(i++)); + assertEquals("order", nameE + ",create", trace.getNameTrace(i++)); + + // assertEquals("order", nameF + ",init", trace.getNameTrace(i++)); + assertEquals("order", nameA + ",init", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",init", trace.getNameTrace(i++)); + assertEquals("order", nameC + ",init", trace.getNameTrace(i++)); + assertEquals("order", nameD + ",init", trace.getNameTrace(i++)); + assertEquals("order", nameE + ",init", trace.getNameTrace(i++)); + + // assertEquals("order", nameF + ",start", trace.getNameTrace(i++)); + assertEquals("order", nameA + ",start", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",start", trace.getNameTrace(i++)); + assertEquals("order", nameC + ",start", trace.getNameTrace(i++)); + assertEquals("order", nameD + ",start", trace.getNameTrace(i++)); + assertEquals("order", nameE + ",start", trace.getNameTrace(i++)); + + } + + /** + * Start regular services, then add a new service and try to start it. + * This should work. + * + * @throws ServiceException + */ + @Test + public void testStartRegistryAndThenAddNewServiceAndStartIt() throws ServiceException { + + // Register some services + String A = "A"; + String B = "B"; + String C = "C"; + servicesRegistry.add(new ServiceFactoryDesc(C, ServiceStartKind.STARTUP)); + servicesRegistry.add(new ServiceFactoryDesc(B, ServiceStartKind.STARTUP, Arrays.asList(C))); + servicesRegistry.add(new ServiceFactoryDesc(A, ServiceStartKind.STARTUP, Arrays.asList(B))); + + // Start them + servicesRegistry.startRegistry(); + + // Register another services as pojo + IService instanciatedService = new ServiceA(); + String key = instanciatedService.getClass().getName(); + servicesRegistry.add(key, 1, instanciatedService); + + // Try to start it + servicesRegistry.startServices(key); + + // check services + assertTrue("service started", servicesRegistry.isStarted(A)); + assertTrue("service started", servicesRegistry.isStarted(B)); + assertTrue("service started", servicesRegistry.isStarted(C)); + + assertTrue("service started", servicesRegistry.isStarted(key)); + + assertEquals("get registered service", instanciatedService, servicesRegistry.getService(key)); + + } + + /** + * Test Service Factory creation + * + * @throws ServiceException + */ + @Test + public void testServiceFactoryCreation() throws ServiceException { + + String A = "A"; + String B = "B"; + String C = "C"; + + // Create services + FakeService.getTrace().reset(); + + servicesRegistry.add(new ServiceFactoryDesc(C, ServiceStartKind.STARTUP)); + servicesRegistry.add(new ServiceFactoryDesc(B, ServiceStartKind.STARTUP, Arrays.asList(C))); + servicesRegistry.add(new ServiceFactoryDesc(A, ServiceStartKind.STARTUP, Arrays.asList(B))); + + // Start services + servicesRegistry.startRegistry(); + + // check services + assertSame("service type", FakeCreatedService.class, servicesRegistry.getService(A).getClass()); + assertSame("service type", FakeCreatedService.class, servicesRegistry.getService(B).getClass()); + + // Get names of created services + String nameA = ((FakeCreatedService) servicesRegistry.getService(A)).getName(); + String nameB = ((FakeCreatedService) servicesRegistry.getService(B)).getName(); + String nameC = ((FakeCreatedService) servicesRegistry.getService(C)).getName(); + + + // check order + // Order should be: C, B, A + TestTrace trace = FakeService.getTrace(); + int i = 0; + assertEquals("order", nameC + ",create", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",create", trace.getNameTrace(i++)); + assertEquals("order", nameA + ",create", trace.getNameTrace(i++)); + + assertEquals("order", nameC + ",init", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",init", trace.getNameTrace(i++)); + assertEquals("order", nameA + ",init", trace.getNameTrace(i++)); + + assertEquals("order", nameC + ",start", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",start", trace.getNameTrace(i++)); + assertEquals("order", nameA + ",start", trace.getNameTrace(i++)); + + // next order is the order of getService() + assertEquals("order", nameA + ",createInstance", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",createInstance", trace.getNameTrace(i++)); + assertEquals("order", nameC + ",createInstance", trace.getNameTrace(i++)); + } + + /** + * Test Creation of Service Factory used with class as key. + * + * @throws ServiceException + */ + @Test + public void testServiceFactoryWithClassKey() throws ServiceException { + + // + Class A = ServiceA.class; + Class B = ServiceB.class; + Class C = ServiceC.class; + + // Specify service types as String + String serviceClassname1 = FakeServiceFactory.class.getName(); + ; + String serviceClassname2 = FakeServiceFactory.class.getName(); + String serviceClassname3 = FakeServiceFactory.class.getName(); + + // Create services + FakeService.getTrace().reset(); + + servicesRegistry.add(new ServiceFactoryDesc(C, serviceClassname3, ServiceStartKind.STARTUP)); + servicesRegistry.add(new ServiceFactoryDesc(B, serviceClassname2, ServiceStartKind.STARTUP, Arrays.asList(C.getName()))); + servicesRegistry.add(new ServiceFactoryDesc(A, serviceClassname1, ServiceStartKind.STARTUP, Arrays.asList(B.getName()))); + + // Start services + servicesRegistry.startRegistry(); + + // check services + assertSame("service type", FakeCreatedService.class, servicesRegistry.getService(A).getClass()); + assertSame("service type", FakeCreatedService.class, servicesRegistry.getService(B).getClass()); + + // Get names of created services + String nameA = ((FakeCreatedService) servicesRegistry.getService(A)).getName(); + String nameB = ((FakeCreatedService) servicesRegistry.getService(B)).getName(); + String nameC = ((FakeCreatedService) servicesRegistry.getService(C)).getName(); + + + // check order (E and F order are not guaranteed) + // Order should be + TestTrace trace = FakeService.getTrace(); + int i = 0; + assertEquals("order", nameC + ",create", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",create", trace.getNameTrace(i++)); + assertEquals("order", nameA + ",create", trace.getNameTrace(i++)); + + assertEquals("order", nameC + ",init", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",init", trace.getNameTrace(i++)); + assertEquals("order", nameA + ",init", trace.getNameTrace(i++)); + + assertEquals("order", nameC + ",start", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",start", trace.getNameTrace(i++)); + assertEquals("order", nameA + ",start", trace.getNameTrace(i++)); + + // next order is the order of getService() + assertEquals("order", nameA + ",createInstance", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",createInstance", trace.getNameTrace(i++)); + assertEquals("order", nameC + ",createInstance", trace.getNameTrace(i++)); + } + + /** + * Test Service Factory creation order. + * One of the factory try to get the required service from its init() method. + * + * @throws ServiceException + */ + @Test + public void testServiceFactoryWithRequiredInInit() throws ServiceException { + + String A = "A"; + String B = "B"; + String C = "C"; + + // Create services C --> A --> B + FakeService.getTrace().reset(); + + // FakeWithRequiredServiceFactory try to retrieve service "C" + servicesRegistry.add(new ServiceFactoryDesc(B, FakeWithRequiredServiceFactory.class.getName(), ServiceStartKind.STARTUP, 1, Arrays.asList(C))); + servicesRegistry.add(new ServiceFactoryDesc(A, FakeWithRequiredServiceFactory.class.getName(), ServiceStartKind.STARTUP, 1, Arrays.asList(B, C))); + servicesRegistry.add(new ServiceFactoryDesc(C, FakeServiceFactory.class.getName(), ServiceStartKind.STARTUP, 1)); + + // Start services + servicesRegistry.startRegistry(); + + // check services + assertSame("service type", FakeCreatedService.class, servicesRegistry.getService(A).getClass()); + assertSame("service type", FakeCreatedService.class, servicesRegistry.getService(B).getClass()); + + // Get names of created services + String nameA = ((FakeCreatedService) servicesRegistry.getService(A)).getName(); + String nameB = ((FakeCreatedService) servicesRegistry.getService(B)).getName(); + String nameC = ((FakeCreatedService) servicesRegistry.getService(C)).getName(); + + + // check order + // Order should be: C, B, A + TestTrace trace = FakeService.getTrace(); + int i = 0; + assertEquals("order", nameC + ",create", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",create", trace.getNameTrace(i++)); + assertEquals("order", nameA + ",create", trace.getNameTrace(i++)); + + assertEquals("order", nameC + ",init", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",init", trace.getNameTrace(i++)); + + assertEquals("order", nameC + ",createInstance", trace.getNameTrace(i++)); + assertEquals("value", servicesRegistry.getService(C), trace.getValue(i)); + assertEquals("order", nameB + ",initEnd", trace.getNameTrace(i++)); + + assertEquals("order", nameA + ",init", trace.getNameTrace(i++)); + assertEquals("order", nameA + ",initEnd", trace.getNameTrace(i++)); + + assertEquals("order", nameC + ",start", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",start", trace.getNameTrace(i++)); + assertEquals("order", nameA + ",start", trace.getNameTrace(i++)); + + // next order is the order of getService() + assertEquals("order", nameA + ",createInstance", trace.getNameTrace(i++)); + // assertEquals("order", nameB + ",createInstance", trace.getNameTrace(i++)); + // assertEquals("order", nameC + ",createInstance", trace.getNameTrace(i++)); + } + + /** + * Test {@link ServicesRegistry#startServicesByClassKeys(List)}. + * Check that services are started. + * + * @throws ServiceException + */ + @Test + public void testStartService() throws ServiceException { + + String A = "A"; + String B = "B"; + String C = "C"; + String D = "D"; + String E = "E"; + + // Create services E --> D --> C --> B --> A + FakeService.getTrace().reset(); + + servicesRegistry.add(new ServiceDesc(E, ServiceStartKind.STARTUP, Arrays.asList(D))); + servicesRegistry.add(new ServiceDesc(D, ServiceStartKind.STARTUP, Arrays.asList(C))); + servicesRegistry.add(new ServiceDesc(C, ServiceStartKind.STARTUP, Arrays.asList(A, B))); + servicesRegistry.add(new ServiceDesc(B, ServiceStartKind.STARTUP, Arrays.asList(A))); + servicesRegistry.add(new ServiceDesc(A, ServiceStartKind.STARTUP)); + + // Start services + servicesRegistry.startServices(Arrays.asList(C)); + + // check services + assertTrue("service started", servicesRegistry.isStarted(A)); + assertTrue("service started", servicesRegistry.isStarted(B)); + assertTrue("service started", servicesRegistry.isStarted(C)); + + // Get names of created services + String nameA = ((FakeService) servicesRegistry.getService(A)).getName(); + String nameB = ((FakeService) servicesRegistry.getService(B)).getName(); + String nameC = ((FakeService) servicesRegistry.getService(C)).getName(); + // String nameD = ((FakeService)servicesRegistry.getService(D)).getName(); + // String nameE = ((FakeService)servicesRegistry.getService(E)).getName(); + // String nameF = ((FakeService)servicesRegistry.getService(F)).getName(); + + + // check order (E and F order are not guaranteed) + // order should be A, B, C + TestTrace trace = FakeService.getTrace(); + int i = 0; + assertEquals("order", nameA + ",create", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",create", trace.getNameTrace(i++)); + assertEquals("order", nameC + ",create", trace.getNameTrace(i++)); + // assertEquals("order", nameD + ",create", trace.getNameTrace(i++)); + // assertEquals("order", nameE + ",create", trace.getNameTrace(i++)); + + assertEquals("order", nameA + ",init", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",init", trace.getNameTrace(i++)); + assertEquals("order", nameC + ",init", trace.getNameTrace(i++)); + // assertEquals("order", nameD + ",init", trace.getNameTrace(i++)); + // assertEquals("order", nameE + ",init", trace.getNameTrace(i++)); + + assertEquals("order", nameA + ",start", trace.getNameTrace(i++)); + assertEquals("order", nameB + ",start", trace.getNameTrace(i++)); + assertEquals("order", nameC + ",start", trace.getNameTrace(i++)); + // assertEquals("order", nameD + ",start", trace.getNameTrace(i++)); + // assertEquals("order", nameE + ",start", trace.getNameTrace(i++)); + + } + + /* **************************************** */ + + + abstract static class TestServiceDescriptor extends ServiceDescriptor { + { + setClassBundleID("org.eclipse.papyrus.infra.core.tests"); + } + + public TestServiceDescriptor(Class key, String serviceClassname, ServiceStartKind serviceStartKind, int priority, boolean isAnonymous, List requiredServices) { + super(key, serviceClassname, serviceStartKind, priority, isAnonymous, requiredServices); + } + + public TestServiceDescriptor(Class key, String serviceClassname, ServiceStartKind serviceStartKind, int priority, List requiredServices) { + super(key, serviceClassname, serviceStartKind, priority, requiredServices); + } + + public TestServiceDescriptor(Class key, String serviceClassname, ServiceStartKind serviceStartKind, int priority) { + super(key, serviceClassname, serviceStartKind, priority); + } + + public TestServiceDescriptor(String serviceClassname, ServiceStartKind serviceStartKind, int priority, boolean isAnonymous) { + super(serviceClassname, serviceStartKind, priority, isAnonymous); + } + + public TestServiceDescriptor(String serviceClassname, ServiceStartKind serviceStartKind, int priority, List requiredServices) { + super(serviceClassname, serviceStartKind, priority, requiredServices); + } + + public TestServiceDescriptor(String serviceClassname, ServiceStartKind serviceStartKind, int priority) { + super(serviceClassname, serviceStartKind, priority); + } + + public TestServiceDescriptor(String key, String serviceClassname, ServiceStartKind serviceStartKind, int priority, boolean isAnonymous, List requiredServices) { + super(key, serviceClassname, serviceStartKind, priority, isAnonymous, requiredServices); + } + + public TestServiceDescriptor(String key, String serviceClassname, ServiceStartKind serviceStartKind, int priority, List requiredServices) { + super(key, serviceClassname, serviceStartKind, priority, requiredServices); + } + + public TestServiceDescriptor(String key, String serviceClassname, ServiceStartKind serviceStartKind, int priority) { + super(key, serviceClassname, serviceStartKind, priority); + } + + } + + + /** + * General purpose descriptor. + */ + public class ServiceDesc extends TestServiceDescriptor { + + + public ServiceDesc(String key, ServiceStartKind startKind) { + super(key, FakeService.class.getName(), startKind, 1); + } + + public ServiceDesc(String key, ServiceStartKind startKind, List requiredService) { + super(key, FakeService.class.getName(), startKind, 1, requiredService); + } + } + + /** + * General purpose descriptor. + */ + public static class ServiceFactoryDesc extends TestServiceDescriptor { + + + public ServiceFactoryDesc(String key, ServiceStartKind startKind) { + super(key, FakeServiceFactory.class.getName(), startKind, 1); + setServiceTypeKind(ServiceTypeKind.serviceFactory); + } + + public ServiceFactoryDesc(String key, ServiceStartKind startKind, List requiredService) { + super(key, FakeServiceFactory.class.getName(), startKind, 1, requiredService); + setServiceTypeKind(ServiceTypeKind.serviceFactory); + } + + /** + * Constructor with a classname and {@link ServiceDescriptor#isStartAtStartup()} = true. + * Constructor. + * + * @param key + * @param startKind + * @param requiredService + */ + public ServiceFactoryDesc(Class key, String classname, ServiceStartKind startKind, List requiredService) { + super(key, classname, startKind, 1, requiredService); + setServiceTypeKind(ServiceTypeKind.serviceFactory); + } + + /** + * Constructor with a classname and {@link ServiceDescriptor#isStartAtStartup()} = true. + * Constructor. + * + * @param key + * @param startKind + * @param requiredService + */ + public ServiceFactoryDesc(Class key, String classname, ServiceStartKind startKind) { + super(key, classname, startKind, 1); + setServiceTypeKind(ServiceTypeKind.serviceFactory); + } + + public ServiceFactoryDesc(String key, String serviceClassname, ServiceStartKind serviceStartKind, int priority, List requiredServices) { + super(key, serviceClassname, serviceStartKind, priority, requiredServices); + setServiceTypeKind(ServiceTypeKind.serviceFactory); + } + + public ServiceFactoryDesc(String key, String serviceClassname, ServiceStartKind serviceStartKind, int priority) { + super(key, serviceClassname, serviceStartKind, priority); + setServiceTypeKind(ServiceTypeKind.serviceFactory); + } + } + + /** + * + * @author dumoulin + * + */ + public class LazyServiceADescriptor extends TestServiceDescriptor { + + + public LazyServiceADescriptor() { + super(ServiceA.class.getName(), ServiceStartKind.LAZY, 1); + } + } + + public class LazyServiceA10Descriptor extends TestServiceDescriptor { + + + public LazyServiceA10Descriptor() { + super(ServiceA.class.getName(), ServiceA10.class.getName(), ServiceStartKind.LAZY, 10); + } + } + + public class LazyServiceBDescriptor extends TestServiceDescriptor { + + + public LazyServiceBDescriptor() { + super(ServiceB.class.getName(), ServiceStartKind.LAZY, 1); + } + } + + public class ServiceCDescriptor extends TestServiceDescriptor { + + + public ServiceCDescriptor() { + super(ServiceC.class.getName(), ServiceStartKind.STARTUP, 1); + } + } + + public class LazyServicePojoADescriptor extends TestServiceDescriptor { + + + public LazyServicePojoADescriptor() { + super(ServicePojoA.class.getName(), ServiceStartKind.LAZY, 1); + } + } + + public class PojoServiceDescriptor extends TestServiceDescriptor { + + + public PojoServiceDescriptor() { + super(Object.class.getName(), ServiceStartKind.STARTUP, 1); + } + } + + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/SharedServiceFactoryTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/SharedServiceFactoryTest.java new file mode 100644 index 00000000000..78424bb56b4 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/SharedServiceFactoryTest.java @@ -0,0 +1,399 @@ +/***************************************************************************** + * 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.infra.core.services; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.sameInstance; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.List; +import java.util.Random; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; +import java.util.stream.IntStream; +import java.util.stream.Stream; + +import org.eclipse.papyrus.junit.utils.rules.AnnotationRule; +import org.junit.After; +import org.junit.Assume; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +/** + * Test cases for the {@link SharedServiceFactory} class. Tests annotated with + * {@link Parallel @Parallel} operate on multiple service registries in parallel + * and the initialization and finalization of services in parallel tests have + * random short delays to try to mix things up for each execution. + */ +public class SharedServiceFactoryTest { + private static final int DEFAULT_REGISTRY_COUNT = 3; + + private static Synchronizer sync; + + @Rule + public final AnnotationRule registryCount = AnnotationRule.create(Registries.class, DEFAULT_REGISTRY_COUNT); + + @Rule + public final AnnotationRule parallelRegistries = AnnotationRule.createExists(Parallel.class); + + private List registries; + + public SharedServiceFactoryTest() { + super(); + } + + @Test + public void uniqueServiceInstances() { + registries().forEach(this::start); + + assertUniqueServiceInstance(Service1.class, Service1Impl.class); + assertUniqueServiceInstance(Service2.class, Service2Impl.class); + } + + @Test + public void serviceNotInitialized() { + registries().forEach(this::start); + + Service1Impl s1 = assumeUniqueServiceInstance(Service1.class, Service1Impl.class); + assertThat(s1.initializedCount.get(), is(0)); + } + + @Test + public void serviceStartedOnce() { + registries().forEach(this::start); + + Service1Impl s1 = assumeUniqueServiceInstance(Service1.class, Service1Impl.class); + assertThat(s1.startedCount.get(), is(1)); + + Service2Impl s2 = assumeUniqueServiceInstance(Service2.class, Service2Impl.class); + assertThat(s2.startedCount.get(), is(1)); + } + + @Test + public void serviceDisposedOnce() { + registries().forEach(this::start); + + Service1Impl s1 = assumeUniqueServiceInstance(Service1.class, Service1Impl.class); + Service2Impl s2 = assumeUniqueServiceInstance(Service2.class, Service2Impl.class); + + destroyFixture(); + + assertThat(s1.disposedCount.get(), is(1)); + assertThat(s2.disposedCount.get(), is(1)); + } + + @Test + public void servicesRecreated() { + registries().forEach(this::start); + + Service1Impl s1 = assumeUniqueServiceInstance(Service1.class, Service1Impl.class); + Service2Impl s2 = assumeUniqueServiceInstance(Service2.class, Service2Impl.class); + + destroyFixture(); + createFixture(); + registries().forEach(this::start); + + Service1Impl s1_ = assumeUniqueServiceInstance(Service1.class, Service1Impl.class); + Service2Impl s2_ = assumeUniqueServiceInstance(Service2.class, Service2Impl.class); + + assertThat(s1, not(sameInstance(s1_))); + assertThat(s2, not(sameInstance(s2_))); + } + + @Registries(64) + @Parallel + @Test + public void parallelAccess() { + // Do a few iterations of this test + for (int i = 0; i < 5; i++) { + if (i > 0) { + // We destroyed the fixture the last time around + createFixture(); + } + + registries().forEach(this::start); + + Service1Impl s1 = assumeUniqueServiceInstance(Service1.class, Service1Impl.class); + Service2Impl s2 = assumeUniqueServiceInstance(Service2.class, Service2Impl.class); + Service3Impl s3 = assumeUniqueServiceInstance(Service3.class, Service3Impl.class); + + destroyFixture(); + + assertThat(s1.startedCount.get(), is(1)); + assertThat(s1.disposedCount.get(), is(1)); + + assertThat(s2.startedCount.get(), is(1)); + assertThat(s2.disposedCount.get(), is(1)); + + assertThat(s3.startedCount.get(), is(1)); + assertThat(s3.disposedCount.get(), is(1)); + } + } + + // + // Test framework + // + + @Before + public void createFixture() { + if (parallelRegistries.get()) { + sync = new ParallelSynchronizer(); + } else { + // No-op synchronizer + sync = () -> { + }; + } + + registries = createServiceRegistries(registryCount.get()); + } + + @After + public void destroyFixture() { + if (registries != null) { + try { + registries().forEach(this::dispose); + } finally { + registries = null; + } + } + + sync = null; + } + + Stream registries() { + return parallelRegistries.get() ? registries.parallelStream() : registries.stream(); + } + + T assertUniqueServiceInstance(Class serviceInterface, Class serviceImpl) { + List result = registries() + .map(r -> getService(r, serviceInterface)) + .distinct() + .collect(Collectors.toList()); + assertThat(result.size(), is(1)); + return serviceImpl.cast(result.get(0)); + } + + T assumeUniqueServiceInstance(Class serviceInterface, Class serviceImpl) { + List result = registries() + .map(r -> getService(r, serviceInterface)) + .distinct() + .collect(Collectors.toList()); + Assume.assumeThat(result.size(), is(1)); + return serviceImpl.cast(result.get(0)); + } + + S getService(ServicesRegistry registry, Class serviceInterface) { + try { + return registry.getService(serviceInterface); + } catch (ServiceException e) { + throw new RuntimeException(e); + } + } + + List createServiceRegistries(int count) { + return IntStream.range(0, count).mapToObj(__ -> createServicesRegistry()).collect(Collectors.toList()); + } + + ServicesRegistry createServicesRegistry() { + ServicesRegistry result = new ServicesRegistry(); + result.add(new ServicesRegistryTest.ServiceFactoryDesc(Service1.class, Service1Factory.class.getName(), ServiceStartKind.LAZY)); + result.add(new ServicesRegistryTest.ServiceFactoryDesc(Service2.class, Service2Factory.class.getName(), ServiceStartKind.LAZY)); + result.add(new ServicesRegistryTest.ServiceFactoryDesc(Service3.class, Service3Factory.class.getName(), ServiceStartKind.LAZY)); + return result; + } + + void start(ServicesRegistry registry) { + try { + registry.startRegistry(); + } catch (ServiceException e) { + throw new RuntimeException(e); + } + } + + void dispose(ServicesRegistry registry) { + try { + registry.disposeRegistry(); + } catch (ServiceException e) { + throw new RuntimeException(e); + } + } + + public interface Service1 extends IService { + // Nothing more + } + + static class Service1Impl implements Service1 { + AtomicInteger initializedCount = new AtomicInteger(); + AtomicInteger startedCount = new AtomicInteger(); + AtomicInteger disposedCount = new AtomicInteger(); + + { + sync.sync(); + } + + @Override + public void init(ServicesRegistry servicesRegistry) throws ServiceException { + initializedCount.incrementAndGet(); + } + + @Override + public void startService() throws ServiceException { + sync.sync(); + startedCount.incrementAndGet(); + } + + @Override + public void disposeService() throws ServiceException { + sync.sync(); + disposedCount.incrementAndGet(); + } + + } + + public static class Service1Factory extends SharedServiceFactory { + + public Service1Factory() { + super(Service1.class, Service1Impl::new); + } + + } + + public interface Service2 { + // Empty + } + + static class Service2Impl implements Service2 { + AtomicInteger startedCount = new AtomicInteger(); + AtomicInteger disposedCount = new AtomicInteger(); + + { + sync.sync(); + } + + void start() throws ServiceException { + sync.sync(); + startedCount.incrementAndGet(); + } + + void dispose() throws ServiceException { + sync.sync(); + disposedCount.incrementAndGet(); + } + + } + + public static class Service2Factory extends SharedServiceFactory { + + public Service2Factory() { + super(Service2.class); + } + + @Override + protected Service2 createSharedInstance() { + return new Service2Impl(); + } + + @Override + protected void start(Service2 sharedInstance) throws ServiceException { + ((Service2Impl) sharedInstance).start(); + } + + @Override + protected void dispose(Service2 sharedInstance) throws ServiceException { + ((Service2Impl) sharedInstance).dispose(); + } + } + + public interface Service3 { + // Empty + } + + static class Service3Impl implements Service3 { + AtomicInteger startedCount = new AtomicInteger(); + AtomicInteger disposedCount = new AtomicInteger(); + + { + sync.sync(); + } + + void start() throws ServiceException { + sync.sync(); + startedCount.incrementAndGet(); + } + + void dispose() throws ServiceException { + sync.sync(); + disposedCount.incrementAndGet(); + } + + } + + public static class Service3Factory extends SharedServiceFactory { + + public Service3Factory() { + super(Service3.class, Service3Impl::new); + } + + @Override + protected void start(Service3 sharedInstance) throws ServiceException { + ((Service3Impl) sharedInstance).start(); + } + + @Override + protected void dispose(Service3 sharedInstance) throws ServiceException { + ((Service3Impl) sharedInstance).dispose(); + } + } + + @Target({ ElementType.TYPE, ElementType.METHOD }) + @Retention(RetentionPolicy.RUNTIME) + public @interface Registries { + int value() default DEFAULT_REGISTRY_COUNT; + } + + @Target({ ElementType.TYPE, ElementType.METHOD }) + @Retention(RetentionPolicy.RUNTIME) + public @interface Parallel { + // Empty + } + + @FunctionalInterface + interface Synchronizer { + void sync(); + } + + /** + * A synchronizer that introduces short random delays into the + * execution of a parallel test case. + */ + static final class ParallelSynchronizer implements Synchronizer { + final Random random = new Random(System.currentTimeMillis()); + + @Override + public void sync() { + try { + Thread.sleep(random.nextInt(100) + 20L); + } catch (Exception e) { + e.printStackTrace(); + // Never mind. Just proceed + } + } + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/TestTrace.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/TestTrace.java new file mode 100644 index 00000000000..e7e81abd7d3 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/services/TestTrace.java @@ -0,0 +1,181 @@ +/** + * + */ +package org.eclipse.papyrus.infra.core.services; + +import java.util.ArrayList; +import java.util.List; + + +/** + * A class used to record traces for tests + * + * @author cedric dumoulin + * + */ +public class TestTrace { + + public Listtraces = new ArrayList(); + + /** + * Record a new trace. + * @param trace + */ + public void addTrace(String trace) { + addTrace(null, trace, null); + } + + /** + * Record a new trace. + * @param trace + */ + public void addTrace(String name, String trace) { + addTrace(name, trace, null); + } + + /** + * Record a new trace. + * @param trace + */ + public void addTrace(String name, String trace, Object value) { + traces.add(new TraceRecord( name, trace, value)); + } + + /** + * Return the name and the trace in one concatenated string ("name,trace"). + * @param i Index of the requested trace + * @return + */ + public String getNameTrace(int i) { + return traces.get(i).getNameTrace(); + } + + /** + * Get the value + * @param i + * @return + */ + public Object getValue(int i) { + return traces.get(i).value; + } + + /** + * Return true if the trace contains the specified events. + * @return + */ + public boolean contains( String name, String trace) { + + return indexOfNameTrace(name, trace) >= 0; + } + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public int indexOf(String name, String trace, Object value) { + + for (int i = 0; i < traces.size(); i++) { + TraceRecord record = traces.get(i); + + if( name.equals(record.name) && trace.equals(record.trace) ) + return i; + } + + return -1; + } + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public int indexOfNameTrace(String name, String trace) { + + for (int i = 0; i < traces.size(); i++) { + TraceRecord record = traces.get(i); + + if( name.equals(record.name) && trace.equals(record.trace) ) + return i; + } + + return -1; + } + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public int indexOfTrace(String trace) { + + for (int i = 0; i < traces.size(); i++) { + TraceRecord record = traces.get(i); + + if( trace.equals(record.trace) ) + return i; + } + + return -1; + } + + /** + * Returns the index of the first occurrence of the specified elements + * in these lists, or -1 if this list does not contain the element. + */ + public int indexOfName(String name) { + + for (int i = 0; i < traces.size(); i++) { + TraceRecord record = traces.get(i); + + if( name.equals(record.name) ) + return i; + } + + return -1; + } + + /** + * Reset the trace. + */ + public void reset() { + traces.clear(); + } + + + /** + * @return the traces + */ + public List getTraces() { + return traces; + } + + /** + * A Record of the trace. + */ + public class TraceRecord { + public String name; + public String trace; + public Object value; + /** + * Constructor. + * + * @param name + * @param trace + * @param value + */ + public TraceRecord(String name, String trace, Object value) { + this.name = name; + this.trace = trace; + this.value = value; + } + + /** + * + * @return + */ + public String getNameTrace() { + // TODO Auto-generated method stub + return name + "," + trace; + } + + } + +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/tests/AllTests.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/tests/AllTests.java new file mode 100644 index 00000000000..8a41e04c361 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/tests/AllTests.java @@ -0,0 +1,57 @@ +/***************************************************************************** + * 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 LIST) - add test for AdapterUtils + * Christian W. Damus (CEA) - bugs 402525, 422257, 399859 + * Christian W. Damus - bugs 456934, 468030, 482949, 485220, 488558, 498140 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.tests; + +import org.eclipse.papyrus.infra.core.language.LanguageServiceTest; +import org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResourceTest; +import org.eclipse.papyrus.infra.core.resource.ModelSetTest; +import org.eclipse.papyrus.infra.core.resource.NestingTransactionalCommandStackTest; +import org.eclipse.papyrus.infra.core.resource.ResourceAdapterTest; +import org.eclipse.papyrus.infra.core.resource.ResourceAdapterTransactionalTest; +import org.eclipse.papyrus.infra.core.services.ComposedServiceTest; +import org.eclipse.papyrus.infra.core.services.ServicesRegistryTest; +import org.eclipse.papyrus.infra.core.services.SharedServiceFactoryTest; +import org.eclipse.papyrus.infra.core.utils.AdapterUtilsTest; +import org.eclipse.papyrus.infra.core.utils.JobBasedFutureTest; +import org.eclipse.papyrus.infra.core.utils.JobExecutorServiceTest; +import org.eclipse.papyrus.infra.core.utils.TransactionHelperTest; +import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; +import org.eclipse.papyrus.junit.framework.runner.Headless; +import org.junit.runner.RunWith; +import org.junit.runners.Suite.SuiteClasses; + + + +@Headless +@RunWith(ClassificationSuite.class) +@SuiteClasses({ + // {oep.resource} + ModelSetTest.class, AbstractModelWithSharedResourceTest.class, NestingTransactionalCommandStackTest.class, + ResourceAdapterTest.class, ResourceAdapterTransactionalTest.class, + // {oep}.core.language + LanguageServiceTest.class, + // {oep}.core.services + ComposedServiceTest.class, ServicesRegistryTest.class, SharedServiceFactoryTest.class, + // {oep}.core.utils + AdapterUtilsTest.class, JobBasedFutureTest.class, JobExecutorServiceTest.class, + TransactionHelperTest.class, +}) +/** + * Suite Class for all tests in the plugin + */ +public class AllTests { + // Junit 4 Test suite +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/AdapterUtilsTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/AdapterUtilsTest.java new file mode 100644 index 00000000000..e1951316491 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/AdapterUtilsTest.java @@ -0,0 +1,170 @@ +/***************************************************************************** + * Copyright (c) 2013 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.infra.core.utils; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.junit.Assert.assertThat; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.common.notify.impl.AdapterImpl; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EcoreFactory; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.hamcrest.BaseMatcher; +import org.hamcrest.Description; +import org.hamcrest.Matcher; +import org.junit.Test; + +import com.google.common.base.Optional; + + +/** + * Tests for the {@link AdapterUtils} class. + */ +public class AdapterUtilsTest extends AbstractPapyrusTest { + + @Test + public void testAdaptInstanceOptionalPresent() { + String foo = "foo"; + + assertThat(AdapterUtils.adapt(foo, String.class), isPresent(String.class)); + } + + @Test + public void testAdaptAdaptableOptionalPresent() { + String foo = "foo"; + + assertThat(AdapterUtils.adapt(new AdaptableWrapper(foo), String.class), isPresent(String.class)); + } + + @Test + public void testAdaptEMFOptionalPresent() { + EObject obj = EcoreFactory.eINSTANCE.createEObject(); + new EMFAdapter(obj); + + assertThat(AdapterUtils.adapt(obj, EMFAdapter.class), isPresent(EMFAdapter.class)); + } + + @Test + public void testAdaptInstanceOptionalNull() { + String foo = "foo"; + + assertThat(AdapterUtils.adapt(foo, Integer.class), isNull(Integer.class)); + } + + @Test + public void testAdaptAdaptableOptionalNull() { + String foo = "foo"; + + assertThat(AdapterUtils.adapt(new AdaptableWrapper(foo), Integer.class), isNull(Integer.class)); + } + + @Test + public void testAdaptEMFOptionalNull() { + EObject obj = EcoreFactory.eINSTANCE.createEObject(); + + assertThat(AdapterUtils.adapt(obj, EMFAdapter.class), isNull(EMFAdapter.class)); + } + + @Test + public void testAdaptInstanceDefaultPresent() { + String foo = "foo"; + + assertThat(AdapterUtils.adapt(foo, String.class, null), is(foo)); + } + + @Test + public void testAdaptAdaptableDefaultPresent() { + String foo = "foo"; + + assertThat(AdapterUtils.adapt(new AdaptableWrapper(foo), String.class, null), is(foo)); + } + + @Test + public void testAdaptEMFDefaultPresent() { + EObject obj = EcoreFactory.eINSTANCE.createEObject(); + EMFAdapter emf = new EMFAdapter(obj); + + assertThat(AdapterUtils.adapt(obj, EMFAdapter.class, null), is(emf)); + } + + @Test + public void testAdaptAdaptableDefaultDefault() { + String foo = "foo"; + + assertThat(AdapterUtils.adapt(new AdaptableWrapper(foo), Integer.class, 42), is(42)); + } + + @Test + public void testAdaptAdaptableDefaultNull() { + String foo = "foo"; + + assertThat(AdapterUtils.adapt(new AdaptableWrapper(foo), Integer.class, null), nullValue()); + } + + // + // Test framework + // + + static Matcher> isPresent(Class type) { + return new BaseMatcher>() { + + public void describeTo(Description description) { + description.appendText("optional value is present"); + } + + public boolean matches(Object item) { + return (item instanceof Optional) && ((Optional)item).isPresent(); + } + }; + } + + static Matcher> isNull(Class type) { + return not(isPresent(type)); + } + + public static class AdaptableWrapper implements IAdaptable { + + private final Class type; + + private final Object instance; + + public AdaptableWrapper(T instance, Class type) { + this.type = type; + this.instance = instance; + } + + public AdaptableWrapper(Object instance) { + this.type = instance.getClass(); + this.instance = instance; + } + + public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) { + return (adapter == type) ? instance : null; + } + } + + public static class EMFAdapter extends AdapterImpl { + + public EMFAdapter(Notifier obj) { + obj.eAdapters().add(this); + } + + @Override + public boolean isAdapterForType(Object type) { + return type == EMFAdapter.class; + } + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobBasedFutureTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobBasedFutureTest.java new file mode 100644 index 00000000000..5047dd18394 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobBasedFutureTest.java @@ -0,0 +1,331 @@ +/***************************************************************************** + * 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.infra.core.utils; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.fail; + +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.jobs.ISchedulingRule; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest; +import org.eclipse.papyrus.junit.matchers.MoreMatchers; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.google.common.base.Supplier; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.util.concurrent.FutureCallback; +import com.google.common.util.concurrent.Futures; + +/** + * JUnit tests for the {@link JobBasedFuture} class. + */ +public class JobBasedFutureTest extends AbstractPapyrusTest { + private static final long FUTURE_DURATION = 3L; + + private static final TimeUnit FUTURE_DURATION_UNIT = TimeUnit.SECONDS; + + private static final int CONCURRENT_THREAD_COUNT = 3; + + private static ExecutorService exec; + + private long startedWhen; + + public JobBasedFutureTest() { + super(); + } + + @Test + public void normalCompletion() { + runGetterThreads(Fixture.returning(true)); + assertRunningTimeAtLeast(2L, TimeUnit.SECONDS); + } + + @Test + public void normalCompletionWithSchedulingRule() { + runGetterThreads(Fixture.returning(true), new RuleSupplier()); + assertRunningTimeAtLeast(2L, TimeUnit.SECONDS); + } + + @Test + public void timeOut() { + runGetterThreads(Fixture.returning(true, 5L, TimeUnit.SECONDS), 2L, TimeUnit.SECONDS); + } + + @Test + public void timeOutWithSchedulingRule() { + runGetterThreads(Fixture.returning(true, 5L, TimeUnit.SECONDS), 2L, TimeUnit.SECONDS, new RuleSupplier()); + } + + @Test + public void computeFails() { + runGetterThreads(Fixture.throwing(TestException.class), TestException.class); + assertRunningTimeAtLeast(2L, TimeUnit.SECONDS); + } + + @Test + public void cancel() { + runGetterThreads(Fixture.returning(true), true); + } + + @Test + public void listen_success() { + addListeners(Fixture.returning(true)); + } + + @Test + public void listen_failure() { + addListeners(Fixture.throwing(TestException.class), TestException.class); + } + + // + // Test framework + // + + @BeforeClass + public static void createExecutor() { + exec = Executors.newCachedThreadPool(); + } + + @AfterClass + public static void shutDownExecutor() { + exec.shutdown(); + exec = null; + } + + @Before + public void starting() { + startedWhen = System.currentTimeMillis(); + } + + void assertRunningTimeAtLeast(long time, TimeUnit unit) { + assertThat("Test running time too short", System.currentTimeMillis() - startedWhen, MoreMatchers.greaterThan(unit.toMillis(time))); + } + + void runGetterThreads(final Fixture fixture) { + runGetterThreads(fixture, 0L, null, null, false, true, null); + } + + void runGetterThreads(final Fixture fixture, Supplier rule) { + runGetterThreads(fixture, 0L, null, rule, false, true, null); + } + + void runGetterThreads(final Fixture fixture, long timeout, TimeUnit unit) { + runGetterThreads(fixture, timeout, unit, null, false, null, TimeoutException.class); + } + + void runGetterThreads(final Fixture fixture, long timeout, TimeUnit unit, Supplier rule) { + runGetterThreads(fixture, timeout, unit, rule, false, null, null); + } + + void runGetterThreads(final Fixture fixture, Boolean expected) { + runGetterThreads(fixture, 0L, null, null, false, expected, null); + } + + void runGetterThreads(final Fixture fixture, boolean cancel) { + runGetterThreads(fixture, 0L, null, null, true, null, null); + } + + void runGetterThreads(final Fixture fixture, Class expectedException) { + runGetterThreads(fixture, 0L, null, null, false, null, expectedException); + } + + private void runGetterThreads(final Fixture fixture, final long timeout, final TimeUnit unit, final Supplier rule, final boolean cancel, Boolean expected, Class expectedException) { + final List results = Lists.newCopyOnWriteArrayList(); + final List thrown = Lists.newCopyOnWriteArrayList(); + final CountDownLatch latch = new CountDownLatch(CONCURRENT_THREAD_COUNT); + + Runnable reader = new Runnable() { + + public void run() { + ISchedulingRule rule_ = (rule == null) ? null : rule.get(); + + try { + if (rule_ != null) { + Job.getJobManager().beginRule(rule_, null); + } + + if (cancel) { + fixture.cancel(true); + } else if (timeout <= 0L) { + results.add(fixture.get()); + } else { + results.add(fixture.get(timeout, unit)); + } + } catch (InterruptedException e) { + thrown.add(e); + } catch (TimeoutException e) { + thrown.add(e); + } catch (ExecutionException e) { + thrown.add(e.getCause()); + } finally { + latch.countDown(); + + if (rule_ != null) { + Job.getJobManager().endRule(rule_); + } + } + } + }; + + for (int i = 0; i < CONCURRENT_THREAD_COUNT; i++) { + exec.submit(reader); + } + + try { + assertThat("Test timed out", latch.await(10L, TimeUnit.MINUTES), is(true)); + } catch (InterruptedException e) { + e.printStackTrace(); + fail("Interrupted waiting for test threads"); + } + + assertThat(results, is((expected == null) ? Collections. emptyList() : Collections.nCopies(CONCURRENT_THREAD_COUNT, expected))); + + if (expectedException != null) { + assertThat(Iterables.size(Iterables.filter(thrown, expectedException)), is(CONCURRENT_THREAD_COUNT)); + } + } + + void addListeners(final Fixture fixture) { + addListeners(fixture, true, null); + } + + void addListeners(final Fixture fixture, Class expectedException) { + addListeners(fixture, null, expectedException); + } + + private void addListeners(final Fixture fixture, Boolean expected, Class expectedException) { + final List results = Lists.newCopyOnWriteArrayList(); + final List thrown = Lists.newCopyOnWriteArrayList(); + final CountDownLatch latch = new CountDownLatch(CONCURRENT_THREAD_COUNT); + + for (int i = 0; i < CONCURRENT_THREAD_COUNT; i++) { + Futures.addCallback(fixture, new FutureCallback() { + public void onSuccess(Boolean result) { + results.add(result); + latch.countDown(); + } + + public void onFailure(Throwable t) { + thrown.add(t); + latch.countDown(); + } + }); + } + + try { + assertThat("Test timed out", latch.await(1L, TimeUnit.MINUTES), is(true)); + } catch (InterruptedException e) { + e.printStackTrace(); + fail("Interrupted waiting for test listeners"); + } + + assertThat(results, is((expected == null) ? Collections. emptyList() : Collections.nCopies(CONCURRENT_THREAD_COUNT, expected))); + + if (expectedException != null) { + assertThat(Iterables.size(Iterables.filter(thrown, expectedException)), is(CONCURRENT_THREAD_COUNT)); + } + + } + + private static class Fixture extends JobBasedFuture { + private final long delay; + private final TimeUnit delayUnit; + + private boolean value = true; + private Class exception; + + Fixture(long delay, TimeUnit delayUnit) { + super("Test fixture"); + + this.delay = delay; + this.delayUnit = delayUnit; + } + + @Override + protected Boolean compute(IProgressMonitor monitor) throws Exception { + if (delay > 0L) { + delayUnit.sleep(delay); + } + + if (exception != null) { + if (Exception.class.isAssignableFrom(exception)) { + throw (Exception) exception.newInstance(); + } else if (Error.class.isAssignableFrom(exception)) { + throw (Error) exception.newInstance(); + } + } + + return value; + } + + static Fixture returning(boolean value) { + return returning(value, FUTURE_DURATION, FUTURE_DURATION_UNIT); + } + + static Fixture returning(boolean value, long delay, TimeUnit unit) { + Fixture result = new Fixture(delay, unit); + result.value = value; + result.schedule(); + return result; + } + + static Fixture throwing(Class exception) { + return throwing(exception, FUTURE_DURATION, FUTURE_DURATION_UNIT); + } + + static Fixture throwing(Class exception, long delay, TimeUnit unit) { + Fixture result = new Fixture(delay, unit); + result.exception = exception; + result.schedule(); + return result; + } + } + + static class TestException extends Exception { + private static final long serialVersionUID = 1L; + + public TestException() { + super(); + } + } + + static class RuleSupplier implements Supplier { + public ISchedulingRule get() { + return new ISchedulingRule() { + public boolean isConflicting(ISchedulingRule rule) { + return rule == this; + } + + public boolean contains(ISchedulingRule rule) { + return rule == this; + } + }; + } + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobExecutorServiceTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobExecutorServiceTest.java new file mode 100644 index 00000000000..2259848c31f --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/JobExecutorServiceTest.java @@ -0,0 +1,145 @@ +/***************************************************************************** + * 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.infra.core.utils; + +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.TimeUnit; + +import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; +import org.junit.Rule; +import org.junit.Test; + +/** + * Automated tests for the {@link JobExecutorService} class. + */ +public class JobExecutorServiceTest { + + @Rule + public final HouseKeeper houseKeeper = new HouseKeeper(); + + public JobExecutorServiceTest() { + super(); + } + + @Test + public void executeAndShutDown() throws Exception { + ExecutorService exec = createFixture(); + + LatchedRunnable run1 = new LatchedRunnable(); + LatchedRunnable run2 = new LatchedRunnable(); + + exec.execute(run1); + exec.execute(run2); + + run1.release(); + run2.release(); + + run1.assertDone(); + run2.assertDone(); + + exec.shutdown(); + assertTerminated(exec); + } + + @Test + public void executeAndShutDownNow() throws Exception { + ExecutorService exec = createFixture(); + + LatchedRunnable run1 = new LatchedRunnable(); + LatchedRunnable run2 = new LatchedRunnable(); + + exec.execute(run1); + exec.execute(run2); + + // Do not release the runnables! + + List pending = exec.shutdownNow(); + + assertShutdown(exec); + assertThat(pending, hasItem(run2)); // Serial execution didn't get this far + + run1.assertNotDone(); + run2.assertNotDone(); + + // Just to clean up + run1.release(); + run2.release(); + + assertTerminated(exec); + } + + // + // Test framework + // + + ExecutorService createFixture() { + return houseKeeper.cleanUpLater(new JobExecutorService(), "shutdownNow"); + } + + void assertShutdown(ExecutorService executorService) throws Exception { + assertThat("Executor not terminated", executorService.isShutdown(), is(true)); + } + + void assertTerminated(ExecutorService executorService) throws Exception { + assertThat("Executor not shut down", executorService.awaitTermination(1L, TimeUnit.SECONDS), is(true)); + assertShutdown(executorService); + assertThat("Executor not terminated", executorService.isTerminated(), is(true)); + } + + static class LatchedRunnable implements Runnable { + private final CountDownLatch startLatch = new CountDownLatch(1); + private final CountDownLatch doneLatch = new CountDownLatch(1); + + private volatile boolean interrupted; + private volatile boolean done; + + public void run() { + try { + startLatch.await(); + + done = true; + doneLatch.countDown(); + } catch (InterruptedException e) { + interrupted = true; + } + } + + void release() { + startLatch.countDown(); + } + + void assertNotInterrupted() { + assertThat("Runnable was interrupted", interrupted, is(false)); + } + + void assertDone() throws InterruptedException { + assertNotInterrupted(); + + doneLatch.await(1L, TimeUnit.SECONDS); + assertThat("Runnable not done", done, is(true)); + } + + void assertNotDone() throws InterruptedException { + assertNotInterrupted(); + + assertThat("Runnable is done", done, is(false)); + } + } +} diff --git a/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/TransactionHelperTest.java b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/TransactionHelperTest.java new file mode 100644 index 00000000000..6499866a806 --- /dev/null +++ b/tests/junit/plugins/infra/core/org.eclipse.papyrus.infra.core.tests/test/org/eclipse/papyrus/infra/core/utils/TransactionHelperTest.java @@ -0,0 +1,194 @@ +/***************************************************************************** + * 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.infra.core.utils; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.fail; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.function.Consumer; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EcoreFactory; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.papyrus.infra.tools.util.IProgressCallable; +import org.eclipse.papyrus.infra.tools.util.IProgressRunnable; +import org.eclipse.papyrus.junit.utils.PrintingProgressMonitor; +import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.Test; + +/** + * Automated tests for the {@link TransactionHelper} class. + */ +public class TransactionHelperTest { + + private static ExecutorService exec; + + @Rule + public final HouseKeeper houseKeeper = new HouseKeeper(); + + private TransactionalEditingDomain domain; + private EClass eclass; + + /** + * Initializes me. + */ + public TransactionHelperTest() { + super(); + } + + @Test + public void testPrivilegedProgressRunnable() { + IProgressRunnable runnable = monitor -> { + monitor.beginTask("Test privileged runnable", 2); + + eclass.setAbstract(true); + monitor.worked(1); + eclass.setName("Foo"); + monitor.worked(1); + + monitor.done(); + }; + + FailureAssertion failure = new FailureAssertion(); + domain.getCommandStack().execute(new RecordingCommand(domain, "Test") { + + @Override + protected void doExecute() { + IProgressRunnable privileged = TransactionHelper.createPrivilegedRunnable(domain, runnable); + Future future = submit(privileged); + + // And synchronize with it + try { + future.get(); + } catch (Exception e) { + failure.accept(e); + } + } + }); + + failure.verify(); + + assertThat(eclass.isAbstract(), is(true)); + assertThat(eclass.getName(), is("Foo")); + } + + @Test + public void testPrivilegedProgressCallable() { + IProgressCallable callable = monitor -> { + monitor.beginTask("Test privileged callable", 2); + + eclass.setAbstract(true); + monitor.worked(1); + eclass.setName("Foo"); + monitor.worked(1); + + monitor.done(); + + return eclass.getName(); + }; + + FailureAssertion failure = new FailureAssertion(); + domain.getCommandStack().execute(new RecordingCommand(domain, "Test") { + + @Override + protected void doExecute() { + IProgressCallable privileged = TransactionHelper.createPrivilegedCallable(domain, callable); + Future future = submit(privileged); + + // And synchronize with it + try { + String newName = future.get(); + assertThat(newName, is("Foo")); + } catch (Exception e) { + failure.accept(e); + } + } + }); + + failure.verify(); + + assertThat(eclass.isAbstract(), is(true)); + assertThat(eclass.getName(), is("Foo")); + } + + // + // Test framework + // + + @BeforeClass + public static void createExecutorService() { + exec = Executors.newSingleThreadExecutor(); + } + + @Before + public void createFixture() throws Exception { + domain = houseKeeper.createSimpleEditingDomain(); + Resource res = domain.createResource("file:bogus.ecore"); + + TransactionHelper.run(domain, () -> { + EPackage epackage = EcoreFactory.eINSTANCE.createEPackage(); + res.getContents().add(epackage); + eclass = EcoreFactory.eINSTANCE.createEClass(); + epackage.getEClassifiers().add(eclass); + }); + } + + @AfterClass + public static void shutdownExecutorService() { + exec.shutdown(); + exec = null; + } + + Future submit(IProgressCallable callable) { + return exec.submit(() -> callable.call(new PrintingProgressMonitor())); + } + + Future submit(IProgressRunnable runnable) { + return exec.submit(() -> runnable.run(new PrintingProgressMonitor())); + } + + // + // Nested types + // + + private static final class FailureAssertion implements Consumer { + private Throwable thrown; + + @Override + public void accept(Throwable t) { + // Take only the first one + if (thrown == null) { + thrown = t; + } + } + + void verify() { + if (thrown != null) { + thrown.printStackTrace(); + fail("Synchronization on future result failed: " + thrown.getMessage()); + } + } + } +} diff --git a/tests/junit/plugins/infra/core/pom.xml b/tests/junit/plugins/infra/core/pom.xml new file mode 100755 index 00000000000..311004b223a --- /dev/null +++ b/tests/junit/plugins/infra/core/pom.xml @@ -0,0 +1,25 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.core.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for the core functions of Papyrus. + + + org.eclipse.papyrus.infra.core.suite.tests + org.eclipse.papyrus.infra.core.clipboard.tests + org.eclipse.papyrus.infra.core.sasheditor.di.tests + org.eclipse.papyrus.infra.core.sasheditor.tests + org.eclipse.papyrus.infra.core.tests + + + diff --git a/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/pom.xml b/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/pom.xml index 39b810bbe75..c1270a8a6a3 100644 --- a/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/pom.xml +++ b/tests/junit/plugins/infra/editor/org.eclipse.papyrus.infra.editor.welcome.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.editor.welcome.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/editor/pom.xml b/tests/junit/plugins/infra/editor/pom.xml new file mode 100755 index 00000000000..897e69243e6 --- /dev/null +++ b/tests/junit/plugins/infra/editor/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.editor.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for the Papyrus infra editor welcome + + + org.eclipse.papyrus.infra.editor.welcome.tests + + + + diff --git a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.gmf.tests/pom.xml b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.gmf.tests/pom.xml index 700df4b93e3..af700410e6a 100644 --- a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.gmf.tests/pom.xml +++ b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.gmf.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.emf.gmf.tests 1.2.100-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly.tests/pom.xml b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly.tests/pom.xml index a253e1efa1c..831bf2842ea 100644 --- a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly.tests/pom.xml +++ b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.emf.readonly.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/pom.xml b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/pom.xml index 84adf7aa7c5..ea0b4ad61b2 100644 --- a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/pom.xml +++ b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.emf.tests 1.4.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/tests/org/eclipse/papyrus/infra/emf/tests/AllTests.java b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/tests/org/eclipse/papyrus/infra/emf/tests/AllTests.java index 46aa80c3609..887de618d7d 100644 --- a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/tests/org/eclipse/papyrus/infra/emf/tests/AllTests.java +++ b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.emf.tests/tests/org/eclipse/papyrus/infra/emf/tests/AllTests.java @@ -24,6 +24,8 @@ import org.eclipse.papyrus.infra.types.core.registries.ElementTypeSetConfigurati import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; import org.eclipse.papyrus.junit.framework.runner.Headless; import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.rules.Timeout; import org.junit.runner.RunWith; import org.junit.runners.Suite.SuiteClasses; @@ -46,6 +48,8 @@ import org.junit.runners.Suite.SuiteClasses; WorkspaceModelIndexTest.class, }) public class AllTests { + @ClassRule + public static Timeout timeout = Timeout.seconds(300); public AllTests() { super(); diff --git a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf.tests/pom.xml b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf.tests/pom.xml index 61532094d16..713aaabd369 100644 --- a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf.tests/pom.xml +++ b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.ui.emf.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/emf/pom.xml b/tests/junit/plugins/infra/emf/pom.xml new file mode 100755 index 00000000000..b3991f09d33 --- /dev/null +++ b/tests/junit/plugins/infra/emf/pom.xml @@ -0,0 +1,25 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.emf.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for infra emf + + + org.eclipse.papyrus.infra.emf.gmf.tests + org.eclipse.papyrus.infra.emf.readonly.tests + org.eclipse.papyrus.infra.emf.tests + org.eclipse.papyrus.infra.ui.emf.tests + + + + diff --git a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/pom.xml b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/pom.xml index f70872f424d..5f8c2a61b49 100644 --- a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/pom.xml +++ b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/pom.xml @@ -3,13 +3,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.eclipse.papyrus.tests.releng org.eclipse.papyrus + org.eclipse.papyrus.tests.releng 1.2.0-SNAPSHOT ../../../../../../../releng/main-tests/pom.xml + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.gmfdiag.assistant.tests - org.eclipse.papyrus 1.2.0-SNAPSHOT eclipse-plugin \ No newline at end of file diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/pom.xml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/pom.xml index 0be1e977aeb..9a940512225 100644 --- a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/pom.xml +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/pom.xml @@ -3,13 +3,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.eclipse.papyrus.tests.releng org.eclipse.papyrus + org.eclipse.papyrus.tests.releng 1.2.0-SNAPSHOT ../../../../../../releng/main-tests/pom.xml + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.gmfdiag.canonical.tests - org.eclipse.papyrus 1.2.0-SNAPSHOT eclipse-test-plugin \ No newline at end of file diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands.tests/pom.xml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands.tests/pom.xml index b443c541512..698cf893d83 100644 --- a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands.tests/pom.xml +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.gmfdiag.commands.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common.tests/pom.xml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common.tests/pom.xml index 889089da13b..3194a3d3814 100644 --- a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common.tests/pom.xml +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.gmfdiag.common.tests 3.0.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/pom.xml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/pom.xml index f1e0eb056d2..5cd726981f8 100644 --- a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/pom.xml +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.gmfdiag.css.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/pom.xml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/pom.xml index 3ee4ce1789d..40d2c5a063f 100644 --- a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/pom.xml +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.gmfdiag.menu.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.welcome.tests/pom.xml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.welcome.tests/pom.xml index 018e9119426..dec5771eeeb 100644 --- a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.welcome.tests/pom.xml +++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.welcome.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.gmfdiag.welcome.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/gmfdiag/pom.xml b/tests/junit/plugins/infra/gmfdiag/pom.xml new file mode 100755 index 00000000000..a865dfac7cc --- /dev/null +++ b/tests/junit/plugins/infra/gmfdiag/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.gmfdiag.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for infra gmfdiag + + + org.eclipse.papyrus.infra.gmfdiag.commands.tests + org.eclipse.papyrus.infra.gmfdiag.common.tests + org.eclipse.papyrus.infra.gmfdiag.canonical.tests + org.eclipse.papyrus.infra.gmfdiag.welcome.tests + org.eclipse.papyrus.infra.gmfdiag.css.tests + org.eclipse.papyrus.infra.gmfdiag.menu.tests + assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests + + + + diff --git a/tests/junit/plugins/infra/internationalization/org.eclipse.papyrus.infra.internationalization.tests/pom.xml b/tests/junit/plugins/infra/internationalization/org.eclipse.papyrus.infra.internationalization.tests/pom.xml index 449bc4da548..ef7fa0162ee 100644 --- a/tests/junit/plugins/infra/internationalization/org.eclipse.papyrus.infra.internationalization.tests/pom.xml +++ b/tests/junit/plugins/infra/internationalization/org.eclipse.papyrus.infra.internationalization.tests/pom.xml @@ -3,11 +3,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.internationalization.main.test - org.eclipse.papyrus 1.0.0-SNAPSHOT + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.internationalization.tests 1.0.0-SNAPSHOT - eclipse-plugin + eclipse-test-plugin \ No newline at end of file diff --git a/tests/junit/plugins/infra/internationalization/pom.xml b/tests/junit/plugins/infra/internationalization/pom.xml index f4e2d1997d3..d36c1dabd1b 100644 --- a/tests/junit/plugins/infra/internationalization/pom.xml +++ b/tests/junit/plugins/infra/internationalization/pom.xml @@ -2,17 +2,15 @@ 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.tests.releng - 1.2.0-SNAPSHOT - ../../../../../releng/main-tests/pom.xml - - org.eclipse.papyrus + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.internationalization.main.test 1.0.0-SNAPSHOT pom - Papyrus Internationalization Test for Infra Papyrus Internationalization are a set of plugins dedicated to manage internationalization labels and languages in relation with models. diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common.tests/pom.xml b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common.tests/pom.xml index db1adb44cd2..0fb8b958958 100644 --- a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common.tests/pom.xml +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common.tests/pom.xml @@ -3,12 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.nattable.main.test 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.nattable.common.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/pom.xml b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/pom.xml index 40eb3423fd1..10c726069db 100644 --- a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/pom.xml +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/pom.xml @@ -3,12 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus - org.eclipse.papyrus.infra.nattable.main.test - 1.2.0-SNAPSHOT - ../pom.xml + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.nattable.main.test + 1.2.0-SNAPSHOT - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.nattable.model.editor.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.tests/pom.xml b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.tests/pom.xml index a4fd81c0be2..5d2664b5c87 100644 --- a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.tests/pom.xml +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.tests/pom.xml @@ -3,12 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus - org.eclipse.papyrus.infra.nattable.main.test - 1.2.0-SNAPSHOT - ../pom.xml + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.nattable.main.test + 1.2.0-SNAPSHOT - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.nattable.model.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.classpath b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.classpath new file mode 100755 index 00000000000..83be1d9f78c --- /dev/null +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.project b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.project new file mode 100755 index 00000000000..27b3850f426 --- /dev/null +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.infra.nattable.suite.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/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.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/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100755 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/.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/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/META-INF/MANIFEST.MF new file mode 100755 index 00000000000..7d799feec97 --- /dev/null +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/META-INF/MANIFEST.MF @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 0.0.1.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.infra.nattable.suite.tests.Activator +Bundle-SymbolicName: org.eclipse.papyrus.infra.nattable.suite.tests +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +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", + org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", + org.eclipse.papyrus.infra.nattable.views.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.nattable.common.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.nattable.model.editor.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.nattable.model.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.nattable.tests;bundle-version="1.2.0", + org.eclipse.papyrus.editor.integration.tests;bundle-version="1.2.0" + \ No newline at end of file diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/Papyrus Nattable Infra tests.launch b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/Papyrus Nattable Infra tests.launch new file mode 100755 index 00000000000..b431c5321b2 --- /dev/null +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/Papyrus Nattable Infra tests.launch @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/about.html b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/about.html new file mode 100755 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/about.html @@ -0,0 +1,28 @@ + + + + +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/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/build.properties b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/build.properties new file mode 100755 index 00000000000..5d52f5264f2 --- /dev/null +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/build.properties @@ -0,0 +1,7 @@ +source.. = test/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + about.html,\ + Papyrus Nattable Infra tests.launch diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/plugin.properties b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/plugin.properties new file mode 100755 index 00000000000..0c6f3ed69f6 --- /dev/null +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/plugin.properties @@ -0,0 +1,12 @@ +################################################################################# +# 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=Infra nattable Tests suite for Papyrus +providerName=Eclipse Modeling Project diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/pom.xml b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/pom.xml new file mode 100755 index 00000000000..3927949f52f --- /dev/null +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/pom.xml @@ -0,0 +1,56 @@ + + + 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.infra.nattable.suite.tests + 0.0.1-SNAPSHOT + eclipse-test-plugin + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + true + true + true + org.eclipse.sdk.ide + + ${skipAllTests} + org.eclipse.papyrus.infra.nattable.suite.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 + + + + + + + + + diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/test/org/eclipse/papyrus/infra/nattable/suite/tests/Activator.java b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/test/org/eclipse/papyrus/infra/nattable/suite/tests/Activator.java new file mode 100755 index 00000000000..38dd524f0ff --- /dev/null +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/test/org/eclipse/papyrus/infra/nattable/suite/tests/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.infra.nattable.suite.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.infra.nattable.suite.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) + */ + @Override + 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) + */ + @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; + } + +} diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/test/org/eclipse/papyrus/infra/nattable/suite/tests/AllTests.java b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/test/org/eclipse/papyrus/infra/nattable/suite/tests/AllTests.java new file mode 100755 index 00000000000..75b77a1367c --- /dev/null +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.suite.tests/test/org/eclipse/papyrus/infra/nattable/suite/tests/AllTests.java @@ -0,0 +1,52 @@ +/***************************************************************************** + * 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.infra.nattable.suite.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<>(); + + /* **************** plugins *********************** */ + + /* nattable tests */ + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.nattable.views.tests.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.nattable.common.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.nattable.model.editor.tests.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.nattable.model.tests.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.nattable.tests.tests.AllTests.class)); + + // end + } + +} diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.tests/pom.xml b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.tests/pom.xml index 430e5a5392c..e94d2b21e59 100644 --- a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.tests/pom.xml +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.tests/pom.xml @@ -3,12 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus - org.eclipse.papyrus.infra.nattable.main.test - 1.2.0-SNAPSHOT - ../pom.xml + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.nattable.main.test + 1.2.0-SNAPSHOT - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.nattable.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests/pom.xml b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests/pom.xml index a99557ff02b..9fb72360fb0 100644 --- a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests/pom.xml +++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.tests/pom.xml @@ -3,12 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus - org.eclipse.papyrus.infra.nattable.main.test - 1.2.0-SNAPSHOT - ../pom.xml + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.nattable.main.test + 1.2.0-SNAPSHOT - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.nattable.views.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/nattable/pom.xml b/tests/junit/plugins/infra/nattable/pom.xml index bf083e8fb2d..651938aa0b3 100755 --- a/tests/junit/plugins/infra/nattable/pom.xml +++ b/tests/junit/plugins/infra/nattable/pom.xml @@ -2,20 +2,19 @@ 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.tests.releng - 1.2.0-SNAPSHOT - ../../../../../releng/main-tests/pom.xml - - org.eclipse.papyrus + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.nattable.main.test 1.2.0-SNAPSHOT pom - Papyrus Nattable Test for Infra Papyrus Nattable are a set of plugins dedicated to manage tables in relation with models. + org.eclipse.papyrus.infra.nattable.suite.tests org.eclipse.papyrus.infra.nattable.common.tests org.eclipse.papyrus.infra.nattable.model.editor.tests org.eclipse.papyrus.infra.nattable.model.tests diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.filters.tests/pom.xml b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.filters.tests/pom.xml index bf51ed31262..40941e65d7e 100644 --- a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.filters.tests/pom.xml +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.filters.tests/pom.xml @@ -3,13 +3,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.eclipse.papyrus.tests.releng org.eclipse.papyrus + org.eclipse.papyrus.tests.releng 1.2.0-SNAPSHOT ../../../../../releng/main-tests/pom.xml + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.filters.tests - org.eclipse.papyrus 1.2.0-SNAPSHOT eclipse-plugin \ No newline at end of file diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.newchild.tests/pom.xml b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.newchild.tests/pom.xml index ea118d3d67b..a436ca79fa3 100644 --- a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.newchild.tests/pom.xml +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.newchild.tests/pom.xml @@ -3,13 +3,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.eclipse.papyrus.tests.releng org.eclipse.papyrus + org.eclipse.papyrus.tests.releng 1.2.0-SNAPSHOT ../../../../../releng/main-tests/pom.xml + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.newchild.tests - org.eclipse.papyrus 1.2.0-SNAPSHOT eclipse-plugin
\ No newline at end of file diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/.classpath b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/.classpath new file mode 100755 index 00000000000..83be1d9f78c --- /dev/null +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/.project b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/.project new file mode 100755 index 00000000000..5036f805a9c --- /dev/null +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.infra.suite.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/infra/org.eclipse.papyrus.infra.suite.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/.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/plugins/infra/org.eclipse.papyrus.infra.suite.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100755 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/.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/plugins/infra/org.eclipse.papyrus.infra.suite.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/META-INF/MANIFEST.MF new file mode 100755 index 00000000000..1d49e96a703 --- /dev/null +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/META-INF/MANIFEST.MF @@ -0,0 +1,42 @@ +Manifest-Version: 1.0 +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 0.0.1.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.infra.suite.tests.Activator +Bundle-SymbolicName: org.eclipse.papyrus.infra.suite.tests +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +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", + org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", + org.eclipse.papyrus.infra.tools.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.ui.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.edit.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.edit.ui.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.labelprovider.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.semantic.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.emf.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.emf.gmf.tests;bundle-version="1.2.1", + org.eclipse.papyrus.infra.ui.emf.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.types.tests;bundle-version="[3.0.0,4.0.0)", + org.eclipse.papyrus.infra.types.ui.tests;bundle-version="[3.0.0,4.0.0)", + org.eclipse.papyrus.infra.gmfdiag.commands.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.common.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.canonical.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.emf.readonly.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.viewpoints.configuration.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.editor.welcome.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.welcome.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.properties.ui.tests;bundle-version="1.2.1", + org.eclipse.papyrus.infra.filters.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.assistant.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.resourceloading.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.controlmode.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.menu.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.css.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.internationalization.tests;bundle-version="1.0.0" + \ No newline at end of file diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/Papyrus Infra tests.launch b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/Papyrus Infra tests.launch new file mode 100755 index 00000000000..d466c958755 --- /dev/null +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/Papyrus Infra tests.launch @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/about.html b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/about.html new file mode 100755 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/about.html @@ -0,0 +1,28 @@ + + + + +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/infra/org.eclipse.papyrus.infra.suite.tests/build.properties b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/build.properties new file mode 100755 index 00000000000..ed4d71c5417 --- /dev/null +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/build.properties @@ -0,0 +1,7 @@ +source.. = test/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + about.html,\ + Papyrus Infra tests.launch diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/plugin.properties b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/plugin.properties new file mode 100755 index 00000000000..aeddeca0fe0 --- /dev/null +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/plugin.properties @@ -0,0 +1,12 @@ +################################################################################# +# 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=Infra Tests suite for Papyrus +providerName=Eclipse Modeling Project diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/pom.xml b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/pom.xml new file mode 100755 index 00000000000..f7bc1c8b0e6 --- /dev/null +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/pom.xml @@ -0,0 +1,56 @@ + + + 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.infra.suite.tests + 0.0.1-SNAPSHOT + eclipse-test-plugin + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + true + true + true + org.eclipse.sdk.ide + + ${skipAllTests} + org.eclipse.papyrus.infra.suite.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 + + + + + + + + + diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/test/org/eclipse/papyrus/infra/suite/tests/Activator.java b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/test/org/eclipse/papyrus/infra/suite/tests/Activator.java new file mode 100755 index 00000000000..27ed2e31ccf --- /dev/null +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/test/org/eclipse/papyrus/infra/suite/tests/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.infra.suite.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.infra.suite.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) + */ + @Override + 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) + */ + @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; + } + +} diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/test/org/eclipse/papyrus/infra/suite/tests/AllTests.java b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/test/org/eclipse/papyrus/infra/suite/tests/AllTests.java new file mode 100755 index 00000000000..e08f06891bf --- /dev/null +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.suite.tests/test/org/eclipse/papyrus/infra/suite/tests/AllTests.java @@ -0,0 +1,78 @@ +/***************************************************************************** + * 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.infra.suite.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<>(); + + /* **************** plugins *********************** */ + + /* infra */ + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.tools.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.ui.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.edit.tests.suites.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.edit.ui.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.labelprovider.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.semantic.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.emf.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.emf.gmf.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.ui.emf.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.types.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.types.ui.tests.AllTests.class)); + // suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.openelement.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.commands.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.common.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.canonical.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.emf.readonly.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.viewpoints.configuration.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.editor.welcome.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.welcome.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.properties.ui.tests.AllTests.class)); + + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.filters.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.assistant.tests.AllTests.class)); + + // FIXME: Workaround for Bug 441246: Move the ResourceLoading tests after EditorReloadTest, since they are currently conflicting + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.resourceloading.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.controlmode.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.menu.tests.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.css.tests.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.internationalization.tests.tests.AllTests.class)); + + + // end + } + +} diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.tools.tests/pom.xml b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.tools.tests/pom.xml index 9d4eab4e7f2..979fcfa7235 100644 --- a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.tools.tests/pom.xml +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.tools.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.tools.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.tests/pom.xml b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.tests/pom.xml index f79e3c87f9a..52afb32b032 100644 --- a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.tests/pom.xml +++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.ui.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/pom.xml b/tests/junit/plugins/infra/pom.xml new file mode 100755 index 00000000000..fd160fe2587 --- /dev/null +++ b/tests/junit/plugins/infra/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.plugins.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for the infra functions of Papyrus. + + + + core + nattable + org.eclipse.papyrus.infra.suite.tests + + + editor + emf + gmfdiag + internationalization + properties + services + types + viewpoints + + + org.eclipse.papyrus.infra.filters.tests + org.eclipse.papyrus.infra.newchild.tests + org.eclipse.papyrus.infra.tools.tests + org.eclipse.papyrus.infra.ui.tests + + + + diff --git a/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/pom.xml b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/pom.xml index dde5b0fccb2..e5ba074f348 100644 --- a/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/pom.xml +++ b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.properties.ui.tests 1.2.1-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/properties/pom.xml b/tests/junit/plugins/infra/properties/pom.xml new file mode 100755 index 00000000000..cd45a90fdd7 --- /dev/null +++ b/tests/junit/plugins/infra/properties/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.properties.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for the Papyrus infra editor welcome + + + org.eclipse.papyrus.infra.properties.ui.tests + + + + diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/pom.xml b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/pom.xml index ac0785e925e..7fddc625f53 100644 --- a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/pom.xml +++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.services.controlmode.tests 1.4.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.tests/pom.xml b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.tests/pom.xml index bb99634613b..ef8447b64b1 100644 --- a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.tests/pom.xml +++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.services.edit.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.ui.tests/pom.xml b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.ui.tests/pom.xml index 74980bbe827..8edc1a8baaf 100644 --- a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.ui.tests/pom.xml +++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.edit.ui.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.services.edit.ui.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/pom.xml b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/pom.xml index a4474cf8d7e..90b6c9dc02c 100644 --- a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/pom.xml +++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.services.labelprovider.tests 1.2.1-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading.tests/pom.xml b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading.tests/pom.xml index 3a73da7f809..a7b3bea4eab 100644 --- a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading.tests/pom.xml +++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.resourceloading.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.services.resourceloading.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic.tests/pom.xml b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic.tests/pom.xml index 0ba7e7ab031..890db16e163 100644 --- a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic.tests/pom.xml +++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.semantic.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.services.semantic.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/services/pom.xml b/tests/junit/plugins/infra/services/pom.xml new file mode 100755 index 00000000000..d8890d44d12 --- /dev/null +++ b/tests/junit/plugins/infra/services/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.services.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for infra services + + + org.eclipse.papyrus.infra.services.edit.tests + org.eclipse.papyrus.infra.services.edit.ui.tests + org.eclipse.papyrus.infra.services.labelprovider.tests + org.eclipse.papyrus.infra.services.semantic.tests + org.eclipse.papyrus.infra.services.resourceloading.tests + org.eclipse.papyrus.infra.services.controlmode.tests + + + + diff --git a/tests/junit/plugins/infra/types/org.eclipse.papyrus.infra.types.tests/pom.xml b/tests/junit/plugins/infra/types/org.eclipse.papyrus.infra.types.tests/pom.xml index 316b3990cec..0e8154b6603 100644 --- a/tests/junit/plugins/infra/types/org.eclipse.papyrus.infra.types.tests/pom.xml +++ b/tests/junit/plugins/infra/types/org.eclipse.papyrus.infra.types.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.types.tests 3.0.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/types/org.eclipse.papyrus.infra.types.ui.tests/pom.xml b/tests/junit/plugins/infra/types/org.eclipse.papyrus.infra.types.ui.tests/pom.xml index 3be8d33e596..76e240e28a4 100644 --- a/tests/junit/plugins/infra/types/org.eclipse.papyrus.infra.types.ui.tests/pom.xml +++ b/tests/junit/plugins/infra/types/org.eclipse.papyrus.infra.types.ui.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.types.ui.tests 3.0.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/infra/types/pom.xml b/tests/junit/plugins/infra/types/pom.xml new file mode 100755 index 00000000000..22cf28ff9b0 --- /dev/null +++ b/tests/junit/plugins/infra/types/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.types.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for infra types model-driven types to the GMF Run-time Element-Types registry. + + + org.eclipse.papyrus.infra.types.tests + org.eclipse.papyrus.infra.types.ui.tests + + + + diff --git a/tests/junit/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.tests/pom.xml b/tests/junit/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.tests/pom.xml index b5a333556e9..58000c6c040 100644 --- a/tests/junit/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.tests/pom.xml +++ b/tests/junit/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.configuration.tests/pom.xml @@ -8,6 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests/pom.xml + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.viewpoints.configuration.tests eclipse-test-plugin \ No newline at end of file diff --git a/tests/junit/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy.tests/pom.xml b/tests/junit/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy.tests/pom.xml index 85d4b481b74..cb501bbbda0 100644 --- a/tests/junit/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy.tests/pom.xml +++ b/tests/junit/plugins/infra/viewpoints/org.eclipse.papyrus.infra.viewpoints.policy.tests/pom.xml @@ -8,6 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests/pom.xml + org.eclipse.papyrus.tests org.eclipse.papyrus.infra.viewpoints.policy.tests eclipse-test-plugin \ No newline at end of file diff --git a/tests/junit/plugins/infra/viewpoints/pom.xml b/tests/junit/plugins/infra/viewpoints/pom.xml new file mode 100755 index 00000000000..b93b4e0a0bc --- /dev/null +++ b/tests/junit/plugins/infra/viewpoints/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.infra.viewpoints.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for infra viewpoints role-based viewpoints customizing the UI experience. + + + org.eclipse.papyrus.infra.viewpoints.configuration.tests + org.eclipse.papyrus.infra.viewpoints.policy.tests + + + + diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/.classpath b/tests/junit/plugins/org.eclipse.papyrus.tests/.classpath new file mode 100644 index 00000000000..83be1d9f78c --- /dev/null +++ b/tests/junit/plugins/org.eclipse.papyrus.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/.project b/tests/junit/plugins/org.eclipse.papyrus.tests/.project new file mode 100644 index 00000000000..7bd1c9ed448 --- /dev/null +++ b/tests/junit/plugins/org.eclipse.papyrus.tests/.project @@ -0,0 +1,28 @@ + + + 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.jdt.core.prefs b/tests/junit/plugins/org.eclipse.papyrus.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/tests/junit/plugins/org.eclipse.papyrus.tests/.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/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 new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/org.eclipse.papyrus.tests/.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/plugins/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..910f3472ecd --- /dev/null +++ b/tests/junit/plugins/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF @@ -0,0 +1,97 @@ +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.100.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.tests.Activator +Bundle-SymbolicName: org.eclipse.papyrus.tests +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", + org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", + org.eclipse.papyrus.bundles.tests;bundle-version="1.2.0", + org.eclipse.papyrus.eclipse.project.editors.tests;bundle-version="2.0.0", + org.eclipse.papyrus.views.modelexplorer.tests;bundle-version="1.2.0", + org.eclipse.papyrus.editor.integration.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.resourceloading.tests;bundle-version="1.2.0", + org.eclipse.papyrus.search.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.css.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.menu.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.controlmode.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.profile.drafter.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.alf.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.internationalization.tests;bundle-version="1.0.0", + org.eclipse.papyrus.uml.internationalization.tests;bundle-version="1.0.0", + org.eclipse.papyrus.uml.internationalization.controlmode.tests;bundle-version="1.0.0", + org.eclipse.papyrus.infra.emf.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.common.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.service.types.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.clazz.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.activity.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.deployment.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.component.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.usecase.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.statemachine.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.communication.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.dnd.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.edit;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.sasheditor.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.sasheditor.di.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.labelprovider.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.timing.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.tools.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.tools.utils.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.nattable.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.nattable.clazz.config.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.nattable.model.editor.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.sequence.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.interactionoverview.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.composite.tests;bundle-version="1.2.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", + org.eclipse.papyrus.infra.emf.readonly.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.common.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.tools.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.wizards.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.modelrepair.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.profile.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.profile.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.nattable.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.nattable.views.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.nattable.generic.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.modelexplorer.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.textedit.port.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.textedit.property.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.textedit.parameter.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.decoratormodel.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.decoratormodel.controlmode.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.nattable.model.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.canonical.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.textedit.valuespecification.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.viewpoints.configuration.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.clipboard.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.nattable.stereotype.display.tests;bundle-version="1.2.0", + org.eclipse.papyrus.tests.framework;bundle-version="1.2.0", + org.eclipse.xtend.lib;bundle-version="2.8.1", + org.eclipse.papyrus.infra.nattable.common.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.editor.welcome.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.welcome.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.validation.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.ui.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.ui.emf.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.edit.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.edit.ui.tests;bundle-version="1.2.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", + org.eclipse.papyrus.uml.service.types.ui.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.emf.gmf.tests;bundle-version="1.2.1", + org.eclipse.papyrus.infra.properties.ui.tests;bundle-version="1.2.1" + 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 new file mode 100644 index 00000000000..34e079c82d8 --- /dev/null +++ b/tests/junit/plugins/org.eclipse.papyrus.tests/Papyrus ALL tests.launch @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/org.eclipse.papyrus.tests/about.html b/tests/junit/plugins/org.eclipse.papyrus.tests/about.html new file mode 100644 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/org.eclipse.papyrus.tests/about.html @@ -0,0 +1,28 @@ + + + + +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 new file mode 100644 index 00000000000..3dce0b4a4cf --- /dev/null +++ b/tests/junit/plugins/org.eclipse.papyrus.tests/build.properties @@ -0,0 +1,7 @@ +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 new file mode 100644 index 00000000000..79c74513d13 --- /dev/null +++ b/tests/junit/plugins/org.eclipse.papyrus.tests/plugin.properties @@ -0,0 +1,12 @@ +################################################################################# +# 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 new file mode 100644 index 00000000000..03e6487f2a8 --- /dev/null +++ b/tests/junit/plugins/org.eclipse.papyrus.tests/pom.xml @@ -0,0 +1,139 @@ + + + 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.100-SNAPSHOT + eclipse-test-plugin + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + true + true + true + org.eclipse.sdk.ide + If a specific is required here, make sure to include JaCoCo parameters (See parent pom, Bug 478170) + 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 new file mode 100644 index 00000000000..87f9b5cd6dc --- /dev/null +++ b/tests/junit/plugins/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/Activator.java @@ -0,0 +1,50 @@ +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 new file mode 100644 index 00000000000..8bb81014c4e --- /dev/null +++ b/tests/junit/plugins/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java @@ -0,0 +1,55 @@ +/***************************************************************************** + * 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 new file mode 100755 index 00000000000..b57f5424484 --- /dev/null +++ b/tests/junit/plugins/pom.xml @@ -0,0 +1,29 @@ + + + 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.plugins.tests.releng + 0.0.1-SNAPSHOT + pom + The top container of plug-in projects tests for the main Papyrus distribution. + + + + + + + developer + editor + infra + + uml + views + + + \ No newline at end of file diff --git a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/.classpath b/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/.classpath deleted file mode 100644 index 098194ca4b7..00000000000 --- a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/.project b/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/.project deleted file mode 100644 index b09b5eeb546..00000000000 --- a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.tests.diagramassistants - - - - - - 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/suites/org.eclipse.papyrus.tests.diagramassistants/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f08be2b06c4..00000000000 --- a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/.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/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/.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/suites/org.eclipse.papyrus.tests.diagramassistants/META-INF/MANIFEST.MF b/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/META-INF/MANIFEST.MF deleted file mode 100644 index 6b1e3a8d35a..00000000000 --- a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/META-INF/MANIFEST.MF +++ /dev/null @@ -1,21 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.junit;bundle-version="4.11.0", - org.eclipse.papyrus.junit.framework;bundle-version="1.2.0", - org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", - org.eclipse.papyrus.bundles.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.filters.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.filters.tests;bundle-version="1.2.0", - org.eclipse.papyrus.infra.gmfdiag.assistant.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.profile.types.generator.tests;bundle-version="1.2.0", - org.eclipse.papyrus.uml.profile.assistants.generator.tests;bundle-version="1.2.0" -Export-Package: org.eclipse.papyrus.tests.diagramassistants -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.tests.diagramassistants -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/Papyrus Diagram Assistants tests.launch b/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/Papyrus Diagram Assistants tests.launch deleted file mode 100644 index 8bf0f4d60a0..00000000000 --- a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/Papyrus Diagram Assistants tests.launch +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/about.html b/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/about.html deleted file mode 100644 index d35d5aed64c..00000000000 --- a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/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/suites/org.eclipse.papyrus.tests.diagramassistants/build.properties b/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/build.properties deleted file mode 100644 index 9d979ed705b..00000000000 --- a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/build.properties +++ /dev/null @@ -1,17 +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/,\ - .,\ - about.html,\ - plugin.properties -src.includes = about.html diff --git a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/documentation.pdoc b/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/documentation.pdoc deleted file mode 100644 index ac57184f163..00000000000 --- a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/documentation.pdoc +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/plugin.properties b/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/plugin.properties deleted file mode 100644 index 95e53e51387..00000000000 --- a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/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=Diagram Assistants Test Suite -providerName=Eclipse Modeling Project diff --git a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/pom.xml b/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/pom.xml deleted file mode 100644 index 2b60219f140..00000000000 --- a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.tests.releng - 1.2.0-SNAPSHOT - ../../../../../releng/main-tests - - org.eclipse.papyrus - org.eclipse.papyrus.tests.diagramassistants - 1.2.0-SNAPSHOT - eclipse-test-plugin - diff --git a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/src/org/eclipse/papyrus/tests/diagramassistants/AllTests.java b/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/src/org/eclipse/papyrus/tests/diagramassistants/AllTests.java deleted file mode 100644 index 9ca38bb8ff8..00000000000 --- a/tests/junit/plugins/suites/org.eclipse.papyrus.tests.diagramassistants/src/org/eclipse/papyrus/tests/diagramassistants/AllTests.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.diagramassistants; - -import java.util.ArrayList; -import java.util.Collection; -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 suite for all Diagram Assistants tests for Papyrus. - */ -@RunWith(AllTestsRunner.class) -public class AllTests { - - @SuiteSpot - public static final List suiteClasses; - - static { - suiteClasses = new ArrayList(); - - // Basic bundle metadata tests (always want to cover the plug-ins we're testing in the suite) - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.bundles.tests.AllTests.class)); - - // Infrastructure layer - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.filters.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.assistant.tests.AllTests.class)); - - // UML layer - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.filters.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.profile.assistants.generator.tests.AllTests.class)); - suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.profile.types.generator.tests.AllTests.class)); - } - - public static void appendTo(Collection suite) { - // Don't include the bundles tests, which the suite we're appending to should already have - suite.addAll(suiteClasses.subList(1, suiteClasses.size())); - } -} diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/pom.xml b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/pom.xml index 41814dcbe4f..0bf8516d10d 100644 --- a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/pom.xml +++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.backend.tests/pom.xml @@ -3,15 +3,15 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.eclipse.papyrus.tests.releng org.eclipse.papyrus - 1.1.0-SNAPSHOT + org.eclipse.papyrus.tests.releng + 1.2.0-SNAPSHOT ../../../../../../releng/main-tests/pom.xml + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.alf.backend.tests - org.eclipse.papyrus 1.1.0-SNAPSHOT - eclipse-plugin + eclipse-test-plugin diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.tests/pom.xml b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.tests/pom.xml index b413fe3acf4..531671a81da 100644 --- a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.tests/pom.xml +++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.tests/pom.xml @@ -3,15 +3,15 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.eclipse.papyrus.tests.releng org.eclipse.papyrus + org.eclipse.papyrus.tests.releng 1.2.0-SNAPSHOT ../../../../../../releng/main-tests/pom.xml + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.alf.tests - org.eclipse.papyrus 1.2.0-SNAPSHOT - eclipse-plugin + eclipse-test-plugin diff --git a/tests/junit/plugins/uml/alf/pom.xml b/tests/junit/plugins/uml/alf/pom.xml new file mode 100755 index 00000000000..0bff009d388 --- /dev/null +++ b/tests/junit/plugins/uml/alf/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.alf.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for the Papyrus uml alf + + + org.eclipse.papyrus.uml.alf.backend.tests + org.eclipse.papyrus.uml.alf.tests + + + + diff --git a/tests/junit/plugins/uml/assistants/org.eclipse.papyrus.uml.profile.assistants.generator.tests/pom.xml b/tests/junit/plugins/uml/assistants/org.eclipse.papyrus.uml.profile.assistants.generator.tests/pom.xml index 1ec8f409a49..1f96ae3102e 100644 --- a/tests/junit/plugins/uml/assistants/org.eclipse.papyrus.uml.profile.assistants.generator.tests/pom.xml +++ b/tests/junit/plugins/uml/assistants/org.eclipse.papyrus.uml.profile.assistants.generator.tests/pom.xml @@ -3,13 +3,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.eclipse.papyrus.tests.releng org.eclipse.papyrus + org.eclipse.papyrus.tests.releng 1.2.0-SNAPSHOT ../../../../../../releng/main-tests/pom.xml + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.profile.assistants.generator.tests - org.eclipse.papyrus 1.2.0-SNAPSHOT eclipse-test-plugin \ No newline at end of file diff --git a/tests/junit/plugins/uml/assistants/org.eclipse.papyrus.uml.profile.types.generator.tests/pom.xml b/tests/junit/plugins/uml/assistants/org.eclipse.papyrus.uml.profile.types.generator.tests/pom.xml index 3b3ba179c7f..42d7322bb77 100644 --- a/tests/junit/plugins/uml/assistants/org.eclipse.papyrus.uml.profile.types.generator.tests/pom.xml +++ b/tests/junit/plugins/uml/assistants/org.eclipse.papyrus.uml.profile.types.generator.tests/pom.xml @@ -3,13 +3,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.eclipse.papyrus.tests.releng org.eclipse.papyrus + org.eclipse.papyrus.tests.releng 1.2.0-SNAPSHOT ../../../../../../releng/main-tests/pom.xml + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.profile.types.generator.tests - org.eclipse.papyrus 1.2.0-SNAPSHOT eclipse-test-plugin \ No newline at end of file diff --git a/tests/junit/plugins/uml/assistants/pom.xml b/tests/junit/plugins/uml/assistants/pom.xml new file mode 100755 index 00000000000..2d999dd948c --- /dev/null +++ b/tests/junit/plugins/uml/assistants/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.assistants.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for the Papyrus uml assistants + + + org.eclipse.papyrus.uml.profile.assistants.generator.tests + + org.eclipse.papyrus.uml.profile.types.generator.tests + + + + diff --git a/tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/pom.xml b/tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/pom.xml index fc45da3173e..043329316cc 100644 --- a/tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/pom.xml +++ b/tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.controlmode.tests/pom.xml @@ -3,13 +3,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.eclipse.papyrus.tests.releng org.eclipse.papyrus + org.eclipse.papyrus.tests.releng 1.2.0-SNAPSHOT ../../../../../../releng/main-tests/pom.xml + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.decoratormodel.controlmode.tests - org.eclipse.papyrus 1.2.0-SNAPSHOT eclipse-test-plugin \ No newline at end of file diff --git a/tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/pom.xml b/tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/pom.xml index be027d2e8a5..49c74abe6c8 100644 --- a/tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/pom.xml +++ b/tests/junit/plugins/uml/decoratormodel/org.eclipse.papyrus.uml.decoratormodel.tests/pom.xml @@ -3,13 +3,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.eclipse.papyrus.tests.releng org.eclipse.papyrus + org.eclipse.papyrus.tests.releng 1.2.0-SNAPSHOT ../../../../../../releng/main-tests/pom.xml + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.decoratormodel.tests - org.eclipse.papyrus 1.2.0-SNAPSHOT eclipse-test-plugin \ No newline at end of file diff --git a/tests/junit/plugins/uml/decoratormodel/pom.xml b/tests/junit/plugins/uml/decoratormodel/pom.xml new file mode 100755 index 00000000000..9d9ece1c5f8 --- /dev/null +++ b/tests/junit/plugins/uml/decoratormodel/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.decoratormodel.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for uml decoratormodel + + + org.eclipse.papyrus.uml.decoratormodel.controlmode.tests + org.eclipse.papyrus.uml.decoratormodel.tests + + + + 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 9f8a966aa29..e6c99eb5883 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 @@ -4,12 +4,11 @@ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.activity.tests 1.2.0-SNAPSHOT eclipse-test-plugin 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 f9547c077da..bf476b755ec 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 @@ -4,12 +4,11 @@ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.clazz.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common.tests/pom.xml index e6bce3c52eb..92a4f8acb91 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common.tests/pom.xml @@ -3,12 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.common.tests 1.2.0-SNAPSHOT eclipse-test-plugin 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 3023e4c07bf..e82b6157d66 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 @@ -4,12 +4,11 @@ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.communication.tests 1.2.0-SNAPSHOT eclipse-test-plugin 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 f16c1980774..e3f118afe12 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 @@ -4,12 +4,11 @@ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.component.tests 1.2.0-SNAPSHOT eclipse-test-plugin 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 52c535b0acc..b03a25f7a61 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 @@ -4,12 +4,11 @@ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.composite.tests 1.2.0-SNAPSHOT eclipse-test-plugin 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 5306014ed85..53766957efc 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 @@ -4,12 +4,11 @@ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.deployment.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd.tests/pom.xml index 342c0485e74..9258d7bbe8d 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.dnd.tests/pom.xml @@ -3,12 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.dnd.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview.tests/pom.xml index 19634321675..ffc5e147617 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.interactionoverview.tests/pom.xml @@ -3,12 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.interactionoverview.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.tests/pom.xml index d7b8944f0b6..247f0a70dec 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.tests/pom.xml @@ -3,12 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.paletteconfiguration.tests 1.2.0-SNAPSHOT eclipse-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/pom.xml index 1d2e8fdc8e2..ff3ed8bfa6b 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile.tests/pom.xml @@ -4,12 +4,11 @@ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.profile.tests 1.2.0-SNAPSHOT eclipse-test-plugin 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 d0fb4cf0017..237546181bd 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 @@ -4,12 +4,11 @@ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.sequence.tests 1.2.0-SNAPSHOT eclipse-test-plugin 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 a54a60abda5..55b4d1ce36b 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 @@ -4,12 +4,11 @@ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.statemachine.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/pom.xml index 48778d527b5..7ca7582d612 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/pom.xml @@ -3,12 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.classpath b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.classpath new file mode 100755 index 00000000000..83be1d9f78c --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.project b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.project new file mode 100755 index 00000000000..81f9a5a19f8 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.uml.diagram.suite.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/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.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/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100755 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/.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/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/META-INF/MANIFEST.MF new file mode 100755 index 00000000000..50dbda00504 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/META-INF/MANIFEST.MF @@ -0,0 +1,32 @@ +Manifest-Version: 1.0 +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 0.0.1.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.uml.diagram.suite.tests.Activator +Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.suite.tests +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +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", + org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.common.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.clazz.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.activity.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.deployment.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.component.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.timing.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.usecase.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.composite.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.statemachine.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.communication.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.profile.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.sequence.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.interactionoverview.tests;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.canonical.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.dynamic.profile.tests;bundle-version="1.2.0" diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/Papyrus Diagram UML tests.launch b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/Papyrus Diagram UML tests.launch new file mode 100755 index 00000000000..d8ee69ffc14 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/Papyrus Diagram UML tests.launch @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/about.html b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/about.html new file mode 100755 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/about.html @@ -0,0 +1,28 @@ + + + + +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/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/build.properties b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/build.properties new file mode 100755 index 00000000000..b127aabc6c0 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/build.properties @@ -0,0 +1,7 @@ +source.. = test/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + about.html,\ + Papyrus Diagram UML tests.launch diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/plugin.properties b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/plugin.properties new file mode 100755 index 00000000000..cf924bafe23 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/plugin.properties @@ -0,0 +1,12 @@ +################################################################################# +# 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=UML diagram Tests suite for Papyrus +providerName=Eclipse Modeling Project diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/pom.xml new file mode 100755 index 00000000000..747cb9f453d --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/pom.xml @@ -0,0 +1,56 @@ + + + 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.uml.diagram.suite.tests + 0.0.1-SNAPSHOT + eclipse-test-plugin + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + true + true + true + org.eclipse.sdk.ide + + ${skipAllTests} + org.eclipse.papyrus.uml.diagram.suite.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 + + + + + + + + + diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/test/org/eclipse/papyrus/uml/diagram/suite/tests/Activator.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/test/org/eclipse/papyrus/uml/diagram/suite/tests/Activator.java new file mode 100755 index 00000000000..b51f57076a7 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/test/org/eclipse/papyrus/uml/diagram/suite/tests/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.uml.diagram.suite.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.uml.diagram.suite.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) + */ + @Override + 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) + */ + @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; + } + +} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/test/org/eclipse/papyrus/uml/diagram/suite/tests/AllTests.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/test/org/eclipse/papyrus/uml/diagram/suite/tests/AllTests.java new file mode 100755 index 00000000000..6a92e0aa4d0 --- /dev/null +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.suite.tests/test/org/eclipse/papyrus/uml/diagram/suite/tests/AllTests.java @@ -0,0 +1,60 @@ +/***************************************************************************** + * 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.uml.diagram.suite.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<>(); + + /* **************** plugins *********************** */ + + /* uml diagrams */ + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.common.tests.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.clazz.test.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.activity.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.deployment.test.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.component.test.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.timing.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.usecase.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.composite.test.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.statemachine.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.communication.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.profile.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.sequence.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.interactionoverview.tests.AllTests.class)); + + // end + } + +} diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.tests/pom.xml index 552ac532e1b..2d793f21563 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests 1.2.0-SNAPSHOT eclipse-test-plugin 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 f33de397105..6676b60e9b0 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 @@ -4,12 +4,11 @@ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.timing.tests 1.2.0-SNAPSHOT eclipse-test-plugin 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 02927ef5f0e..468aeb507fe 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 @@ -4,12 +4,11 @@ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.usecase.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards.tests/pom.xml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards.tests/pom.xml index 8725b5ada90..18379d32caf 100644 --- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards.tests/pom.xml +++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards.tests/pom.xml @@ -3,12 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.wizards.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/diagram/pom.xml b/tests/junit/plugins/uml/diagram/pom.xml index eb0cbace647..61d1cfcd603 100644 --- a/tests/junit/plugins/uml/diagram/pom.xml +++ b/tests/junit/plugins/uml/diagram/pom.xml @@ -4,17 +4,17 @@ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 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.uml.tests.releng + 0.0.1-SNAPSHOT - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.diagram.tests.releng 1.2.0-SNAPSHOT pom + org.eclipse.papyrus.uml.diagram.suite.tests org.eclipse.papyrus.uml.diagram.activity.tests org.eclipse.papyrus.uml.diagram.clazz.tests org.eclipse.papyrus.uml.diagram.statemachine.tests diff --git a/tests/junit/plugins/uml/internationalization/org.eclipse.papyrus.uml.internationalization.controlmode.tests/pom.xml b/tests/junit/plugins/uml/internationalization/org.eclipse.papyrus.uml.internationalization.controlmode.tests/pom.xml index 3b33570d28c..256e983e14b 100644 --- a/tests/junit/plugins/uml/internationalization/org.eclipse.papyrus.uml.internationalization.controlmode.tests/pom.xml +++ b/tests/junit/plugins/uml/internationalization/org.eclipse.papyrus.uml.internationalization.controlmode.tests/pom.xml @@ -3,11 +3,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.internationalization.main.test - org.eclipse.papyrus 1.0.0-SNAPSHOT + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.internationalization.controlmode.tests 1.0.0-SNAPSHOT - eclipse-plugin + eclipse-test-plugin \ No newline at end of file diff --git a/tests/junit/plugins/uml/internationalization/org.eclipse.papyrus.uml.internationalization.tests/pom.xml b/tests/junit/plugins/uml/internationalization/org.eclipse.papyrus.uml.internationalization.tests/pom.xml index 2a070d527e6..67063858fd0 100644 --- a/tests/junit/plugins/uml/internationalization/org.eclipse.papyrus.uml.internationalization.tests/pom.xml +++ b/tests/junit/plugins/uml/internationalization/org.eclipse.papyrus.uml.internationalization.tests/pom.xml @@ -3,11 +3,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.internationalization.main.test - org.eclipse.papyrus 1.0.0-SNAPSHOT + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.internationalization.tests 1.0.0-SNAPSHOT - eclipse-plugin + eclipse-test-plugin \ No newline at end of file diff --git a/tests/junit/plugins/uml/internationalization/pom.xml b/tests/junit/plugins/uml/internationalization/pom.xml index 12f27b42d8d..e4b7f30a752 100644 --- a/tests/junit/plugins/uml/internationalization/pom.xml +++ b/tests/junit/plugins/uml/internationalization/pom.xml @@ -2,17 +2,15 @@ 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.tests.releng - 1.2.0-SNAPSHOT - ../../../../../releng/main-tests/pom.xml - - org.eclipse.papyrus + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.internationalization.main.test 1.0.0-SNAPSHOT pom - Papyrus Internationalization Test for UML Papyrus Internationalization are a set of plugins dedicated to manage internationalization labels and language in relation with models. diff --git a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/pom.xml b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/pom.xml index c55d7852851..58cc21079c0 100644 --- a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/pom.xml +++ b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.modelexplorer.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/modelexplorer/pom.xml b/tests/junit/plugins/uml/modelexplorer/pom.xml new file mode 100755 index 00000000000..df5d6d9e25d --- /dev/null +++ b/tests/junit/plugins/uml/modelexplorer/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.modelexplorer.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for the Papyrus uml model explorer + + + org.eclipse.papyrus.uml.modelexplorer.tests + + + + diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/pom.xml b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/pom.xml index 519cae888d2..d1dc2b135a5 100644 --- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/pom.xml +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.clazz.config.tests/pom.xml @@ -3,13 +3,12 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.nattable.main.test 1.2.0-SNAPSHOT - ../pom.xml + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.nattable.clazz.config.tests - org.eclipse.papyrus 1.2.0-SNAPSHOT eclipse-test-plugin \ No newline at end of file diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/pom.xml b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/pom.xml index 6b9d5764bdc..5bc35a3946f 100644 --- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/pom.xml +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/pom.xml @@ -3,12 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.nattable.main.test 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.nattable.generic.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotype.display.tests/pom.xml b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotype.display.tests/pom.xml index 2c1a3799652..315bd8c02dc 100644 --- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotype.display.tests/pom.xml +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotype.display.tests/pom.xml @@ -3,13 +3,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.nattable.main.test 1.2.0-SNAPSHOT - ../pom.xml - + + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.nattable.stereotype.display.tests - org.eclipse.papyrus 1.2.0-SNAPSHOT eclipse-test-plugin \ No newline at end of file diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/pom.xml b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/pom.xml index e6aae8749a1..b792b1c954d 100644 --- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/pom.xml +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests/pom.xml @@ -3,12 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.nattable.main.test 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests 1.0.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.classpath b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.classpath new file mode 100755 index 00000000000..83be1d9f78c --- /dev/null +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.project b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.project new file mode 100755 index 00000000000..ee89c28da70 --- /dev/null +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.uml.nattable.suite.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/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.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/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100755 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/.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/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/META-INF/MANIFEST.MF new file mode 100755 index 00000000000..c80bbf4a433 --- /dev/null +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 0.0.1.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.uml.nattable.suite.tests.Activator +Bundle-SymbolicName: org.eclipse.papyrus.uml.nattable.suite.tests +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +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", + org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", + org.eclipse.papyrus.uml.nattable.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.nattable.generic.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.nattable.clazz.config.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.nattable.stereotype.display.tests;bundle-version="1.2.0", + org.eclipse.papyrus.editor.integration.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.dynamic.profile.tests;bundle-version="1.2.0" diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/Papyrus Nattable UML tests.launch b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/Papyrus Nattable UML tests.launch new file mode 100755 index 00000000000..938bbf6f795 --- /dev/null +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/Papyrus Nattable UML tests.launch @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/about.html b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/about.html new file mode 100755 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/about.html @@ -0,0 +1,28 @@ + + + + +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/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/build.properties b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/build.properties new file mode 100755 index 00000000000..d4effb4cd8d --- /dev/null +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/build.properties @@ -0,0 +1,7 @@ +source.. = test/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + about.html,\ + Papyrus Nattable UML tests.launch diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/plugin.properties b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/plugin.properties new file mode 100755 index 00000000000..cfbeaa2c464 --- /dev/null +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/plugin.properties @@ -0,0 +1,12 @@ +################################################################################# +# 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=UML nattable Tests suite for Papyrus +providerName=Eclipse Modeling Project diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/pom.xml b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/pom.xml new file mode 100755 index 00000000000..3ba7ee3bc0e --- /dev/null +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/pom.xml @@ -0,0 +1,56 @@ + + + 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.uml.nattable.suite.tests + 0.0.1-SNAPSHOT + eclipse-test-plugin + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + true + true + true + org.eclipse.sdk.ide + + ${skipAllTests} + org.eclipse.papyrus.uml.nattable.suite.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 + + + + + + + + + diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/test/org/eclipse/papyrus/uml/nattable/suite/tests/Activator.java b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/test/org/eclipse/papyrus/uml/nattable/suite/tests/Activator.java new file mode 100755 index 00000000000..0a65b04e58f --- /dev/null +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/test/org/eclipse/papyrus/uml/nattable/suite/tests/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.uml.nattable.suite.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.uml.nattable.suite.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) + */ + @Override + 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) + */ + @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; + } + +} diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/test/org/eclipse/papyrus/uml/nattable/suite/tests/AllTests.java b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/test/org/eclipse/papyrus/uml/nattable/suite/tests/AllTests.java new file mode 100755 index 00000000000..b77dde8ab01 --- /dev/null +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.suite.tests/test/org/eclipse/papyrus/uml/nattable/suite/tests/AllTests.java @@ -0,0 +1,51 @@ +/***************************************************************************** + * 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.uml.nattable.suite.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<>(); + + /* **************** plugins *********************** */ + + /* nattable tests */ + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.nattable.tests.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.nattable.generic.tests.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.nattable.clazz.config.tests.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.nattable.stereotype.display.tests.tests.AllTests.class)); + + // end + } + +} diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.tests/pom.xml b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.tests/pom.xml index 86b9800bbb4..13c35002189 100644 --- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.tests/pom.xml +++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.tests/pom.xml @@ -3,12 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.nattable.main.test 1.2.0-SNAPSHOT - ../pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.nattable.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/nattable/pom.xml b/tests/junit/plugins/uml/nattable/pom.xml index ad4b678340d..fc84d099206 100755 --- a/tests/junit/plugins/uml/nattable/pom.xml +++ b/tests/junit/plugins/uml/nattable/pom.xml @@ -2,25 +2,27 @@ 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.tests.releng - 1.2.0-SNAPSHOT - ../../../../../releng/main-tests/pom.xml - - org.eclipse.papyrus + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.nattable.main.test 1.2.0-SNAPSHOT pom - Papyrus Nattable Test for UML Papyrus Nattable are a set of plugins dedicated to manage tables in relation with models. + + org.eclipse.papyrus.uml.nattable.suite.tests + + org.eclipse.papyrus.uml.nattable.clazz.config.tests org.eclipse.papyrus.uml.nattable.generic.tests org.eclipse.papyrus.uml.nattable.stereotype.display.tests - org.eclipse.papyrus.uml.nattable.tests org.eclipse.papyrus.uml.nattable.stereotyped.elements.tests + org.eclipse.papyrus.uml.nattable.tests \ No newline at end of file diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/.classpath b/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/.classpath deleted file mode 100644 index da1049abda9..00000000000 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/.project b/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/.project deleted file mode 100644 index c8c4ca6aa1d..00000000000 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.search.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/uml/org.eclipse.papyrus.search.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 73da3815343..00000000000 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,295 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 -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/uml/org.eclipse.papyrus.search.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.search.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/uml/org.eclipse.papyrus.search.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/META-INF/MANIFEST.MF deleted file mode 100644 index f227d5c6c25..00000000000 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,13 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui.ide;bundle-version="3.8.0", - org.junit;bundle-version="4.10.0", - org.eclipse.papyrus.junit.framework;bundle-version="1.2.0" -Export-Package: org.eclipse.papyrus.search.tests.suites -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.search.tests -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/about.html b/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/about.html deleted file mode 100644 index 5ddc72c177f..00000000000 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

November 20, 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/uml/org.eclipse.papyrus.search.tests/build.properties b/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/build.properties deleted file mode 100644 index a8e3182967e..00000000000 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties,\ - about.html -src.includes = about.html diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/plugin.properties b/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/plugin.properties deleted file mode 100644 index 991bf48dd09..00000000000 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/plugin.properties +++ /dev/null @@ -1,14 +0,0 @@ -################################################################################# -# Copyright (c) 2011 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. -# -################################################################################## -pluginName=Papyrus Search Tests -providerName=Eclipse Modeling Project diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/pom.xml b/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/pom.xml deleted file mode 100644 index 08c5aae03e1..00000000000 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus - org.eclipse.papyrus.tests.releng - 1.2.0-SNAPSHOT - ../../../../../releng/main-tests - - org.eclipse.papyrus - org.eclipse.papyrus.search.tests - 1.2.0-SNAPSHOT - eclipse-test-plugin - diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/src/org/eclipse/papyrus/search/tests/suites/AllTests.java b/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/src/org/eclipse/papyrus/search/tests/suites/AllTests.java deleted file mode 100644 index 6dd9e7a1dbe..00000000000 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.search.tests/src/org/eclipse/papyrus/search/tests/suites/AllTests.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.eclipse.papyrus.search.tests.suites; - -import org.junit.runner.RunWith; -import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; -import org.junit.runners.Suite.SuiteClasses; - -/** - * Main Test suite. - */ -@RunWith(ClassificationSuite.class) -@SuiteClasses({}) -public class AllTests { - //TODO: Model-Search tests -} diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.dynamic.profile.tests/pom.xml b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.dynamic.profile.tests/pom.xml index 9de11d759ab..e6eb6047f52 100644 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.dynamic.profile.tests/pom.xml +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.dynamic.profile.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.dynamic.profile.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.filters.tests/pom.xml b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.filters.tests/pom.xml index dac13fcbd21..976e2e52d84 100644 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.filters.tests/pom.xml +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.filters.tests/pom.xml @@ -3,13 +3,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.eclipse.papyrus.tests.releng org.eclipse.papyrus + org.eclipse.papyrus.tests.releng 1.2.0-SNAPSHOT ../../../../../releng/main-tests/pom.xml + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.filters.tests - org.eclipse.papyrus 1.2.0-SNAPSHOT eclipse-plugin \ No newline at end of file diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/pom.xml b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/pom.xml index 7f15f824dde..c9deebeb803 100644 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/pom.xml +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.modelrepair.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.modelrepair.tests 1.2.100-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.profile.tests/pom.xml b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.profile.tests/pom.xml index 41463f418fa..374d0c0cb04 100644 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.profile.tests/pom.xml +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.profile.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.profile.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/pom.xml b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/pom.xml index 7bb37ddf8f8..4834641e115 100644 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/pom.xml +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.service.types.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.ui.tests/pom.xml b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.ui.tests/pom.xml index 1603b5d5052..4be73cab0ba 100644 --- a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.ui.tests/pom.xml +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.ui.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.service.types.ui.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/.classpath b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/.classpath new file mode 100755 index 00000000000..83be1d9f78c --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/.project b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/.project new file mode 100755 index 00000000000..8ee9916ac98 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.uml.suite.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/uml/org.eclipse.papyrus.uml.suite.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/.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/plugins/uml/org.eclipse.papyrus.uml.suite.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100755 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/.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/plugins/uml/org.eclipse.papyrus.uml.suite.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/META-INF/MANIFEST.MF new file mode 100755 index 00000000000..9f4381d2f20 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/META-INF/MANIFEST.MF @@ -0,0 +1,40 @@ +Manifest-Version: 1.0 +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 0.0.1.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.uml.suite.tests.Activator +Bundle-SymbolicName: org.eclipse.papyrus.uml.suite.tests +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +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", + org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", + org.eclipse.papyrus.uml.service.types.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.service.types.ui.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.modelexplorer.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.dnd.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.tools.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.tools.utils.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.wizards.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.modelrepair.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.profile.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.decoratormodel.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.decoratormodel.controlmode.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.validation.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.filters.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.profile.assistants.generator.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.profile.types.generator.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.profile.drafter.tests;bundle-version="1.2.0", + org.eclipse.papyrus.views.modelexplorer.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.validation.tests.staticprofile;bundle-version="1.2.0", + org.eclipse.papyrus.uml.dynamic.profile.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.internationalization.tests;bundle-version="1.0.0", + org.eclipse.papyrus.uml.internationalization.controlmode.tests;bundle-version="1.0.0", + org.eclipse.papyrus.uml.alf.tests;bundle-version="1.2.0" + \ No newline at end of file diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/Papyrus UML tests.launch b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/Papyrus UML tests.launch new file mode 100755 index 00000000000..43aebdd7281 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/Papyrus UML tests.launch @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/about.html b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/about.html new file mode 100755 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/about.html @@ -0,0 +1,28 @@ + + + + +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/uml/org.eclipse.papyrus.uml.suite.tests/build.properties b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/build.properties new file mode 100755 index 00000000000..2857f80ee88 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/build.properties @@ -0,0 +1,7 @@ +source.. = test/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + about.html,\ + Papyrus UML tests.launch diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/plugin.properties b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/plugin.properties new file mode 100755 index 00000000000..d83acfdb369 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/plugin.properties @@ -0,0 +1,12 @@ +################################################################################# +# 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=UML Tests suite for Papyrus +providerName=Eclipse Modeling Project diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/pom.xml b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/pom.xml new file mode 100755 index 00000000000..3d87c8e65c8 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/pom.xml @@ -0,0 +1,56 @@ + + + 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.uml.suite.tests + 0.0.1-SNAPSHOT + eclipse-test-plugin + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + true + true + true + org.eclipse.sdk.ide + + ${skipAllTests} + org.eclipse.papyrus.uml.suite.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 + + + + + + + + + diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/test/org/eclipse/papyrus/uml/suite/tests/Activator.java b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/test/org/eclipse/papyrus/uml/suite/tests/Activator.java new file mode 100755 index 00000000000..c9198957955 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/test/org/eclipse/papyrus/uml/suite/tests/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.uml.suite.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.uml.suite.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) + */ + @Override + 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) + */ + @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; + } + +} diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/test/org/eclipse/papyrus/uml/suite/tests/AllTests.java b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/test/org/eclipse/papyrus/uml/suite/tests/AllTests.java new file mode 100755 index 00000000000..a324b3fdec2 --- /dev/null +++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.suite.tests/test/org/eclipse/papyrus/uml/suite/tests/AllTests.java @@ -0,0 +1,70 @@ +/***************************************************************************** + * 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.uml.suite.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<>(); + + /* **************** plugins *********************** */ + + /* uml */ + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.service.types.tests.suites.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.service.types.ui.tests.suites.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.modelexplorer.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.dnd.tests.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.tools.tests.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.tools.utils.tests.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.stereotypeproperty.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.diagram.wizards.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.modelrepair.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.profile.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.decoratormodel.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.decoratormodel.controlmode.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.validation.tests.AllTests.class)); + + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.filters.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.profile.assistants.generator.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.profile.types.generator.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.profile.drafter.tests.AllTests.class)); + + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.internationalization.tests.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.internationalization.controlmode.tests.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.alf.tests.AllTests.class)); + + + // end + } + +} diff --git a/tests/junit/plugins/uml/pom.xml b/tests/junit/plugins/uml/pom.xml new file mode 100755 index 00000000000..ea679ad156d --- /dev/null +++ b/tests/junit/plugins/uml/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.plugins.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for the core uml functions of Papyrus. + + + + diagram + nattable + textedit + org.eclipse.papyrus.uml.suite.tests + + + alf + assistants + decoratormodel + internationalization + modelexplorer + profile + tools + validation + + + org.eclipse.papyrus.uml.dynamic.profile.tests + org.eclipse.papyrus.uml.filters.tests + org.eclipse.papyrus.uml.modelrepair.tests + org.eclipse.papyrus.uml.profile.tests + org.eclipse.papyrus.uml.service.types.tests + org.eclipse.papyrus.uml.service.types.ui.tests + + + + diff --git a/tests/junit/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter.tests/pom.xml b/tests/junit/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter.tests/pom.xml index 23d5006997b..cb3c2d2be29 100644 --- a/tests/junit/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter.tests/pom.xml +++ b/tests/junit/plugins/uml/profile/org.eclipse.papyrus.uml.profile.drafter.tests/pom.xml @@ -3,13 +3,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.eclipse.papyrus.tests.releng org.eclipse.papyrus + org.eclipse.papyrus.tests.releng 1.2.0-SNAPSHOT ../../../../../../releng/main-tests/pom.xml + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.profile.drafter.tests - org.eclipse.papyrus 1.2.0-SNAPSHOT eclipse-test-plugin \ No newline at end of file diff --git a/tests/junit/plugins/uml/profile/pom.xml b/tests/junit/plugins/uml/profile/pom.xml new file mode 100755 index 00000000000..6150c6e5a20 --- /dev/null +++ b/tests/junit/plugins/uml/profile/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.profile.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for the Papyrus uml profiles + + + org.eclipse.papyrus.uml.profile.drafter.tests + + + + diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/pom.xml b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/pom.xml index 59efdab4998..fdc105fa3a1 100644 --- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/pom.xml +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.textedit.parameter.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/pom.xml b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/pom.xml index 24dfde3ac1d..13c84a776be 100644 --- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/pom.xml +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.textedit.port.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/pom.xml b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/pom.xml index dbd3822886b..22ac8400505 100644 --- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/pom.xml +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.textedit.property.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.classpath b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.classpath new file mode 100755 index 00000000000..83be1d9f78c --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.project b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.project new file mode 100755 index 00000000000..53d1e05fc55 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.uml.textedit.suite.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/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.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/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100755 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/.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/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/META-INF/MANIFEST.MF new file mode 100755 index 00000000000..592dd0716d9 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 0.0.1.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.uml.textedit.suite.tests.Activator +Bundle-SymbolicName: org.eclipse.papyrus.uml.textedit.suite.tests +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +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", + org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", + org.eclipse.papyrus.uml.textedit.port.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.textedit.property.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.textedit.parameter.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.textedit.valuespecification.tests;bundle-version="1.2.0", + org.eclipse.papyrus.uml.textedit.tests;bundle-version="1.2.0" + \ No newline at end of file diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/Papyrus Textedit tests.launch b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/Papyrus Textedit tests.launch new file mode 100755 index 00000000000..76c252858a1 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/Papyrus Textedit tests.launch @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/about.html b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/about.html new file mode 100755 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/about.html @@ -0,0 +1,28 @@ + + + + +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/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/build.properties b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/build.properties new file mode 100755 index 00000000000..08215542f34 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/build.properties @@ -0,0 +1,7 @@ +source.. = test/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + about.html,\ + Papyrus Textedit tests.launch diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/plugin.properties b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/plugin.properties new file mode 100755 index 00000000000..67d2a5010f0 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/plugin.properties @@ -0,0 +1,12 @@ +################################################################################# +# 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=UML textedit Tests suite for Papyrus +providerName=Eclipse Modeling Project diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/pom.xml b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/pom.xml new file mode 100755 index 00000000000..5c926fb34f5 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/pom.xml @@ -0,0 +1,56 @@ + + + 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.uml.textedit.suite.tests + 0.0.1-SNAPSHOT + eclipse-test-plugin + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + true + true + true + org.eclipse.sdk.ide + + ${skipAllTests} + org.eclipse.papyrus.uml.textedit.suite.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 + + + + + + + + + diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/test/org/eclipse/papyrus/uml/textedit/suite/tests/Activator.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/test/org/eclipse/papyrus/uml/textedit/suite/tests/Activator.java new file mode 100755 index 00000000000..f4436ffa2fe --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/test/org/eclipse/papyrus/uml/textedit/suite/tests/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.uml.textedit.suite.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.uml.textedit.suite.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) + */ + @Override + 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) + */ + @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; + } + +} diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/test/org/eclipse/papyrus/uml/textedit/suite/tests/AllTests.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/test/org/eclipse/papyrus/uml/textedit/suite/tests/AllTests.java new file mode 100755 index 00000000000..19d58dc3497 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.suite.tests/test/org/eclipse/papyrus/uml/textedit/suite/tests/AllTests.java @@ -0,0 +1,51 @@ +/***************************************************************************** + * 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.uml.textedit.suite.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<>(); + + /* **************** plugins *********************** */ + + /* uml textedit tests */ + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.textedit.port.tests.suites.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.textedit.property.tests.suites.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.textedit.parameter.tests.suites.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.textedit.valuespecification.tests.suites.AllTests.class)); + + // end + } + +} diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests/pom.xml b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests/pom.xml index cefa4fd4a42..4aa55508fc1 100644 --- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests/pom.xml +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.textedit.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/pom.xml b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/pom.xml index 4dfac48bff6..237efa62bc5 100644 --- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/pom.xml +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.textedit.valuespecification.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/textedit/pom.xml b/tests/junit/plugins/uml/textedit/pom.xml new file mode 100755 index 00000000000..561ee3a6aaf --- /dev/null +++ b/tests/junit/plugins/uml/textedit/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.textedit.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for the embedded textual editors for UML constructs in the Papyrus diagrams. + + + org.eclipse.papyrus.uml.textedit.suite.tests + org.eclipse.papyrus.uml.textedit.tests + org.eclipse.papyrus.uml.textedit.port.tests + org.eclipse.papyrus.uml.textedit.property.tests + org.eclipse.papyrus.uml.textedit.parameter.tests + org.eclipse.papyrus.uml.textedit.valuespecification.tests + + + diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/pom.xml b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/pom.xml index a1387fc2464..fdae0ab87c1 100644 --- a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/pom.xml +++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.tools.tests 3.0.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils.tests/pom.xml b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils.tests/pom.xml index dc291f7ffd2..37ba31cd000 100644 --- a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils.tests/pom.xml +++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.tools.utils.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/tools/pom.xml b/tests/junit/plugins/uml/tools/pom.xml new file mode 100755 index 00000000000..7570c3235c1 --- /dev/null +++ b/tests/junit/plugins/uml/tools/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.tools.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for uml tools + + + org.eclipse.papyrus.uml.tools.utils.tests + org.eclipse.papyrus.uml.tools.tests + + + + diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.genvalidation/pom.xml b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.genvalidation/pom.xml index 85b61c9606c..132897ad8a1 100644 --- a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.genvalidation/pom.xml +++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.genvalidation/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.validation.tests.genvalidation 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/pom.xml b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/pom.xml index 7abdb98345d..f13483b1e42 100644 --- a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/pom.xml +++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests.staticprofile/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.validation.tests.staticprofile 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/pom.xml b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/pom.xml index f1dfbdf15f6..8523a04596e 100644 --- a/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/pom.xml +++ b/tests/junit/plugins/uml/validation/org.eclipse.papyrus.uml.validation.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.uml.validation.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/uml/validation/pom.xml b/tests/junit/plugins/uml/validation/pom.xml new file mode 100755 index 00000000000..c9643d5be4e --- /dev/null +++ b/tests/junit/plugins/uml/validation/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.uml.validation.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for uml validation + + + org.eclipse.papyrus.uml.validation.tests + org.eclipse.papyrus.uml.validation.tests.genvalidation + org.eclipse.papyrus.uml.validation.tests.staticprofile + + + + diff --git a/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/pom.xml b/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/pom.xml index 0334a2c8f02..cc74a4214a3 100644 --- a/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/pom.xml +++ b/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/pom.xml @@ -8,7 +8,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.views.modelexplorer.tests 1.2.0-SNAPSHOT eclipse-test-plugin diff --git a/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/.classpath b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/.classpath new file mode 100755 index 00000000000..83be1d9f78c --- /dev/null +++ b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/.project b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/.project new file mode 100755 index 00000000000..75176712f79 --- /dev/null +++ b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.views.suite.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/views/org.eclipse.papyrus.views.suite.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/.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/plugins/views/org.eclipse.papyrus.views.suite.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100755 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/.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/plugins/views/org.eclipse.papyrus.views.suite.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/META-INF/MANIFEST.MF new file mode 100755 index 00000000000..52d8638c63b --- /dev/null +++ b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/META-INF/MANIFEST.MF @@ -0,0 +1,19 @@ +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 0.0.1.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.views.suite.tests.Activator +Bundle-SymbolicName: org.eclipse.papyrus.views.suite.tests +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", + org.eclipse.papyrus.junit.utils;bundle-version="1.2.0", + org.eclipse.papyrus.bundles.tests;bundle-version="1.2.0", + org.eclipse.papyrus.eclipse.project.editors.tests;bundle-version="2.0.0", + org.eclipse.papyrus.views.modelexplorer.tests;bundle-version="1.2.0", + org.eclipse.papyrus.editor.integration.tests;bundle-version="1.2.0" diff --git a/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/Papyrus Views ALL tests.launch b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/Papyrus Views ALL tests.launch new file mode 100755 index 00000000000..ffa3c4954d6 --- /dev/null +++ b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/Papyrus Views ALL tests.launch @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/about.html b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/about.html new file mode 100755 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/about.html @@ -0,0 +1,28 @@ + + + + +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/views/org.eclipse.papyrus.views.suite.tests/build.properties b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/build.properties new file mode 100755 index 00000000000..0b54259f7d3 --- /dev/null +++ b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/build.properties @@ -0,0 +1,7 @@ +source.. = test/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + about.html,\ + Papyrus Views ALL tests.launch diff --git a/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/plugin.properties b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/plugin.properties new file mode 100755 index 00000000000..d50275728e5 --- /dev/null +++ b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/plugin.properties @@ -0,0 +1,12 @@ +################################################################################# +# 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 Views +providerName=Eclipse Modeling Project diff --git a/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/pom.xml b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/pom.xml new file mode 100755 index 00000000000..3460978dca1 --- /dev/null +++ b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/pom.xml @@ -0,0 +1,56 @@ + + + 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.views.suite.tests + 0.0.1-SNAPSHOT + eclipse-test-plugin + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + true + true + true + org.eclipse.sdk.ide + + ${skipAllTests} + org.eclipse.papyrus.views.suite.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 + + + + + + + + + diff --git a/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/test/org/eclipse/papyrus/views/suite/tests/Activator.java b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/test/org/eclipse/papyrus/views/suite/tests/Activator.java new file mode 100755 index 00000000000..cb55f221861 --- /dev/null +++ b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/test/org/eclipse/papyrus/views/suite/tests/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.views.suite.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.views.suite.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) + */ + @Override + 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) + */ + @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; + } + +} diff --git a/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/test/org/eclipse/papyrus/views/suite/tests/AllTests.java b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/test/org/eclipse/papyrus/views/suite/tests/AllTests.java new file mode 100755 index 00000000000..40bbaac8a69 --- /dev/null +++ b/tests/junit/plugins/views/org.eclipse.papyrus.views.suite.tests/test/org/eclipse/papyrus/views/suite/tests/AllTests.java @@ -0,0 +1,55 @@ +/***************************************************************************** + * 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.views.suite.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<>(); + + /* **************** plugins *********************** */ + + /* customization */ + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.eclipse.project.editors.tests.AllTests.class)); + + /* views */ + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.views.modelexplorer.tests.AllTests.class)); + + /* integration */ + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.editor.integration.tests.AllTests.class)); + + + // end + } + +} diff --git a/tests/junit/plugins/views/pom.xml b/tests/junit/plugins/views/pom.xml new file mode 100755 index 00000000000..4ddb512b99b --- /dev/null +++ b/tests/junit/plugins/views/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + org.eclipse.papyrus.tests + org.eclipse.papyrus.plugins.tests.releng + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.tests + org.eclipse.papyrus.views.tests.releng + 0.0.1-SNAPSHOT + pom + Tests for the Papyrus views + + + + org.eclipse.papyrus.views.suite.tests + + + modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests + properties/org.eclipse.papyrus.views.properties.toolsmiths.tests + + + + diff --git a/tests/junit/plugins/views/properties/org.eclipse.papyrus.views.properties.toolsmiths.tests/pom.xml b/tests/junit/plugins/views/properties/org.eclipse.papyrus.views.properties.toolsmiths.tests/pom.xml index 8794d3c537e..ec51d24a4f2 100644 --- a/tests/junit/plugins/views/properties/org.eclipse.papyrus.views.properties.toolsmiths.tests/pom.xml +++ b/tests/junit/plugins/views/properties/org.eclipse.papyrus.views.properties.toolsmiths.tests/pom.xml @@ -9,7 +9,7 @@ 1.2.0-SNAPSHOT ../../../../../../releng/main-tests/pom.xml - org.eclipse.papyrus + org.eclipse.papyrus.tests org.eclipse.papyrus.views.properties.toolsmiths.tests 1.2.0-SNAPSHOT eclipse-test-plugin -- cgit v1.2.3