diff options
| author | Maxime Porhel | 2015-09-14 12:03:46 +0000 |
|---|---|---|
| committer | Maxime Porhel | 2015-09-14 12:57:21 +0000 |
| commit | de8b0096f1108b8c7c5460aec8976a0346e71621 (patch) | |
| tree | 1fa3df27f1fac2961f3f8f6d874c8f3a361ce74c | |
| parent | 0f636b815543dc6330e1641fb662958b37a18618 (diff) | |
| download | org.eclipse.sirius-de8b0096f1108b8c7c5460aec8976a0346e71621.tar.gz org.eclipse.sirius-de8b0096f1108b8c7c5460aec8976a0346e71621.tar.xz org.eclipse.sirius-de8b0096f1108b8c7c5460aec8976a0346e71621.zip | |
[477208] Test that the IllegalArgumentException does not occur anymore
Bug: 477208
Change-Id: Icf1c18ae771c56b4d8d02da71a416ad32bac4df5
Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
| -rw-r--r-- | plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SelectAllAndDeselectionTest.java | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SelectAllAndDeselectionTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SelectAllAndDeselectionTest.java index 723190eb54..b8f0e6e5c2 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SelectAllAndDeselectionTest.java +++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/SelectAllAndDeselectionTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010-2015 THALES GLOBAL SERVICES. + * Copyright (c) 2010-2015 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -28,6 +28,7 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart; import org.eclipse.jface.bindings.keys.KeyStroke; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.sirius.diagram.DDiagram; +import org.eclipse.sirius.diagram.ui.internal.edit.parts.AbstractDiagramElementContainerNameEditPart; import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase; import org.eclipse.sirius.tests.swtbot.support.api.business.UILocalSession; import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource; @@ -41,6 +42,7 @@ import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefViewer; import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; import org.eclipse.swtbot.swt.finder.results.VoidResult; import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; +import org.junit.Assert; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -142,6 +144,30 @@ public class SelectAllAndDeselectionTest extends AbstractSiriusSwtBotGefTestCase } /** + * Ensures that the 'Select All' action selects the expected EditParts and + * that the attempt to select a container label does not lead to + * IllegalArgumentException. + */ + public void testSelectAllAndTryContainerLabelSelection() { + // Wait all UI events to ensure that the tabbar is correctly refreshed. + SWTBotUtils.waitAllUiEvents(); + + editor.bot().toolbarDropDownButtonWithTooltip("Select &All").click(); + checkSelectedEditParts(getEditPartsFromNames(PACKAGE_1_NAME, PACKAGE_2_NAME, PACKAGE_3_NAME, CLASS_1_NAME, CLASS_2_NAME, CLASS_3_NAME, CLASS_4_NAME)); + + SWTBotGefEditPart labelPart = editor.getEditPart(PACKAGE_1_NAME); + assertTrue(labelPart.part() instanceof AbstractDiagramElementContainerNameEditPart); + labelPart.click(); + + // Check there is no more IllegalArgumentException when the user click + // on the label of a secondary selected part. + if (doesAnErrorOccurs()) { + Assert.fail(getErrorLoggersMessage()); + } + checkSelectedEditParts(Lists.newArrayList(getEditPartsFromNames(PACKAGE_1_NAME))); + } + + /** * Ensures that container deselection works. */ public void testSelectAllAndUnselectOneContainer() { |
