diff options
| author | Laurent Redor | 2018-04-13 07:25:19 +0000 |
|---|---|---|
| committer | Laurent Redor | 2018-04-13 07:39:34 +0000 |
| commit | 1cd5fe7cc21325c38a16d3ddf91521afbf692e3b (patch) | |
| tree | 98320f2ad03f973e232c6e3a6f136322bded97c7 | |
| parent | 79b885cfc61404de12ca713fe82eba6eff8f383b (diff) | |
| download | org.eclipse.sirius-1cd5fe7cc21325c38a16d3ddf91521afbf692e3b.tar.gz org.eclipse.sirius-1cd5fe7cc21325c38a16d3ddf91521afbf692e3b.tar.xz org.eclipse.sirius-1cd5fe7cc21325c38a16d3ddf91521afbf692e3b.zip | |
[525804] Fixes InvalidMetamodelRessourceTest
This commit ensures that test InvalidMetamodelRessourceTest continues to
be OK even with old Eclipse version.
Bug: 525804
Change-Id: I31e9c1fa48bc36baeafa3cd624b109ab239b069f
Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
4 files changed, 33 insertions, 7 deletions
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html index 70fa0f3512..80e748b0f7 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html +++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html @@ -241,6 +241,14 @@ <code>org.eclipse.sirius.ui.business.api.viewpoint.ViewpointSelectionDialog</code> has been removed. </li> </ul> + <h4 id="Changesinorg.eclipse.sirius.tests.junit.support">Changes in + <code>org.eclipse.sirius.tests.junit.support</code> + </h4> + <ul> + <li><span class="label label-success">Added</span> + <code>org.eclipse.sirius.tests.support.api.TestsUtil.isBeforeOxygenPlatform()</code> has been added to detect if the current platform corresponds to a version before Oxygen. + </li> + </ul> <h4 id="Migrations">Migrations</h4> <ul> <li><span class="label label-success">Added</span> A migration participant has been added to fix diagram with note attachment corrupted (see @@ -324,7 +332,7 @@ <code>org.eclipse.sirius.ui.business.api.dialect.ExportFormat</code> has a new attribute representing the scaling level to use for diagram export. It is defined by an integer type. Refer to the JavaDoc for details on its meaning. </li> </ul> - <h4 id="Changesinorg.eclipse.sirius.tests.junit.support">Changes in + <h4 id="Changesinorg.eclipse.sirius.tests.junit.support2">Changes in <code>org.eclipse.sirius.tests.junit.support</code> </h4> <ul> @@ -1188,7 +1196,7 @@ <code>AbstractMetamodelPropertySectionSpec</code>. Those classes are now used for the edition of the metamodels of both the Properties view description and the various representations. </li> </ul> - <h4 id="Changesinorg.eclipse.sirius.tests.junit.support2">Changes in + <h4 id="Changesinorg.eclipse.sirius.tests.junit.support3">Changes in <code>org.eclipse.sirius.tests.junit.support</code> </h4> <ul> @@ -1752,7 +1760,7 @@ SWTBotUtils.waitAllUiEvents(); <code>org.eclipse.sirius.ext.gef</code> is deprecated and will be removed in the next version. </li> </ul> - <h4 id="Changesinorg.eclipse.sirius.tests.junit.support3">Changes in + <h4 id="Changesinorg.eclipse.sirius.tests.junit.support4">Changes in <code>org.eclipse.sirius.tests.junit.support</code> </h4> <ul> @@ -2241,7 +2249,7 @@ SWTBotUtils.waitAllUiEvents(); <code>org.eclipse.sirius.editor</code>) still depends on PDE (and thus indirectly the JDT too). </li> </ul> - <h4 id="Changesinorg.eclipse.sirius.tests.junit.support4">Changes in + <h4 id="Changesinorg.eclipse.sirius.tests.junit.support5">Changes in <code>org.eclipse.sirius.tests.junit.support</code> </h4> <ul> diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile index 65f2139084..1592653275 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile +++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile @@ -50,6 +50,10 @@ h4. Changes in @org.eclipse.sirius.ui@ * <span class="label label-danger">Removed</span> The class @org.eclipse.sirius.ui.business.api.viewpoint.ViewpointSelectionDialog@ has been removed. +h4. Changes in @org.eclipse.sirius.tests.junit.support@ + +* <span class="label label-success">Added</span> @org.eclipse.sirius.tests.support.api.TestsUtil.isBeforeOxygenPlatform()@ has been added to detect if the current platform corresponds to a version before Oxygen. + h4. Migrations * <span class="label label-success">Added</span> A migration participant has been added to fix diagram with note attachment corrupted (see "bugzilla #533175":https://bugs.eclipse.org/bugs/show_bug.cgi?id=533175 for more details). The corresponding version, stored in attribute version of viewpoint:DAnalysis of the aird file, is _13.0.0.201804031646_. diff --git a/plugins/org.eclipse.sirius.tests.junit.support/src/org/eclipse/sirius/tests/support/api/TestsUtil.java b/plugins/org.eclipse.sirius.tests.junit.support/src/org/eclipse/sirius/tests/support/api/TestsUtil.java index df6ad88474..7c88b23396 100644 --- a/plugins/org.eclipse.sirius.tests.junit.support/src/org/eclipse/sirius/tests/support/api/TestsUtil.java +++ b/plugins/org.eclipse.sirius.tests.junit.support/src/org/eclipse/sirius/tests/support/api/TestsUtil.java @@ -211,7 +211,7 @@ public final class TestsUtil { */ Bundle uiWorkbenchBundle = Platform.getBundle("org.eclipse.ui.workbench"); if (uiWorkbenchBundle != null) { - return uiWorkbenchBundle.getVersion().compareTo(versiontStart) >= 0 && (versionEnd == null || uiWorkbenchBundle.getVersion().compareTo(versionEnd) < 0); + return (versiontStart == null || uiWorkbenchBundle.getVersion().compareTo(versiontStart) >= 0) && (versionEnd == null || uiWorkbenchBundle.getVersion().compareTo(versionEnd) < 0); } return false; } @@ -237,6 +237,15 @@ public final class TestsUtil { } /** + * Tells if the current platform corresponds to a version before Oxygen. + * + * @return true if the current platform corresponds to a version before Oxygen, false otherwise. + */ + public static boolean isBeforeOxygenPlatform() { + return checkUiWorkbenchVersion(null, Version.parseVersion(UI_WORKBENCH_OXYGEN_START)); + } + + /** * Tells if the current platform corresponds to Oxygen or later. * * @return true if the current platform corresponds to Oxygen or later, false otherwise. diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/InvalidMetamodelRessourceTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/InvalidMetamodelRessourceTest.java index c8a93fb879..7e0fa216dd 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/InvalidMetamodelRessourceTest.java +++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/InvalidMetamodelRessourceTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014, 2017 Obeo. + * Copyright (c) 2014, 2018 Obeo. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.tests.swtbot; +import org.eclipse.sirius.tests.support.api.TestsUtil; import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase; import org.eclipse.sirius.tests.swtbot.support.api.condition.TreeItemExpanded; import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper; @@ -106,7 +107,11 @@ public class InvalidMetamodelRessourceTest extends AbstractSiriusSwtBotGefTestCa SWTBotTreeItem expandNode = viewsTreeBot.expandNode("General"); bot.waitUntil(new TreeItemExpanded(expandNode, expandNode.getText())); expandNode.getNode("Error Log").click(); - bot.button("Open").click(); + if (TestsUtil.isBeforeOxygenPlatform()) { + bot.button("OK").click(); + } else { + bot.button("Open").click(); + } } /** |
